@SebastianLague
  @SebastianLague
Sebastian Lague | Unity Create a Game Series (E03. enemies) @SebastianLague | Uploaded 9 years ago | Updated 16 hours 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:
https://github.com/SebLague/Create-a-Game-Source

Follow me on twitter @SebastianLague
Support my videos on Patreon: http://bit.ly/sebPatreon
Unity Create a Game Series (E03. enemies)Procedural Landmass Generation (E14: flatshading)Unity Shape Editor Tool (4/4)[Unity] Creating a 2D Platformer (E11. camera follow)Procedural Landmass Generation (E02: Noise Map)Blender Character Creation (E02: Modelling)Coding Adventure: Ant and Slime Simulations[Unity] Programming Practice: Sliding Blocks 2/2Introduction to Game Development (E17: reference vs value types)Introduction to Game Development (E02: classes)Procedural Landmass Generation (E16: colour shader)Procedural Landmass Generation (E17: texture shader)

Unity Create a Game Series (E03. enemies) @SebastianLague