Self Study #4.1
In this self study we had to make a simple game where there are enemies that spawn and chase the player, reducing the player’s health on collision. I had to tweak some of my chase script, namely adding a line to find the object with the “Player” tag on startup.
targetParent = GameObject.FindGameObjectWithTag("Player");
target = targetParent.GetComponent<CharacterController>();
After doing that the script worked fine with the spawner, other than the fact that after the initial gameObject the script was referencing was despawned (de-activated using the trigger script) it would stop spawning enemies (because the original no longer was active, it would spawn non-active enemies). This was fixed with the tried and true workaround of “the referenced gameObject being unreachable”. I did try exporting the gameObject into a prefab and have the spawner reference that, however that did not work because it needed some non-runtime bits and bobs from the player with the health script applied for the trigger script to interact with the player.
Other than that, smooth sailing through this one :-)
Gif of player getting a health pack
Gif of player losing health and dying and game over screen
Get utas kit207 portfolio
utas kit207 portfolio
Status | In development |
Category | Other |
Author | rqcoon |
More posts
- Bonus Round!Apr 05, 2025
- Tutorial #5Apr 01, 2025
- Self Study #5Apr 01, 2025
- Self Study #3Apr 01, 2025
- Self Study #4.2Mar 24, 2025
- Tutorial #3Mar 18, 2025
- Tutorial #2Mar 17, 2025
- Self Study #2Mar 10, 2025
- Tutorial #1Mar 06, 2025
Leave a comment
Log in with itch.io to leave a comment.