Uploaded September 2015 | Updated September 2026, 2 weeks ago
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:
github.com/SebLague/Create-a-Game-Source
Follow me on twitter @SebastianLague
Support my videos on Patreon: bit.ly/sebPatreon
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:
github.com/SebLague/Create-a-Game-Source
Follow me on twitter @SebastianLague
Support my videos on Patreon: bit.ly/sebPatreon


![[Unity] Creating a 2D Platformer (E11. camera follow)
[Unity] Creating a 2D Platformer (E11. camera follow) [Unity] Creating a 2D Platformer (E11. camera follow)](https://i.ytimg.com/vi/WL_PaUyRAXQ/mqdefault.jpg)



![[Unity] Programming Practice: Sliding Blocks 2/2
Finishing off the sliding blocks project.
Previous ep: https://www.youtube.com/watch?v=ZrM7uCxtM6E
Source:
https://github.com/SebLague/Programming-Practice/tree/master/Sliding%20Blocks
Support the creation of more gamedev tutorials:
https://www.patreon.com/SebastianLague
https://www.paypal.me/SebastianLague [Unity] Programming Practice: Sliding Blocks 2/2](https://i.ytimg.com/vi/X8YnoIq1d1g/mqdefault.jpg)



