Hello,
I’m creating a 2d platformer. I have followed the various ‘Enemy Follow a player tutorial’ I’ve found online. I can get the enemy to chase the player, but how do I get the enemy to stay grounded? I have a collision box that detects interaction with the player, but the collision does not seem to recognize walls or level geometry.
I’ve tried to add a Rigidbody and a checked the ‘use gravity’ box, but nothing seem to recognize collisions. Any advice on how to add gravity through code? Thanks for your help.
Sidenote: I think that the LookAt.FindObjectWithTag"Player" (Pseudocode) was causing the enemy to spin out of control. i’m not sure if this is also causing the enemy to ‘float’