2015-09-19
[public] 82.0K views, 1.26K likes, 9.00 dislikes audio only
In episode three we create an enemy to chase the player around.
FAQ:
Q: QueryTriggerInteraction does not exist in the current context?
A: Upgrade to Unity 5.2+, or leave that parameter out and turn on raycast triggers in the physics settings (edit - project settings)
Q: Why use raycasts instead of OnTriggerEnter to detect projectile collisions?
A: At very high projectile speeds OnTriggerEnter might not be called (since the projectile would be in front of enemy one frame, and through it the next). Raycasting just makes sure that collisions will work no matter the projectile speed.
Source code:
https://github.com/SebLague/Create-a-Game-Source
Follow me on twitter @SebastianLague
Support my videos on Patreon: http://bit.ly/sebPatreon