im using transform.translate for movement and need help with a script that pushes the player back on the x and z axis if the enemy collides with them. issue is that it pushes the player down on the y and they get stuck.
changing to addforce with rigidbody is not an option
You can set PushDirection.y = 0 before you apply it to the other transform.
I’m not sure if Time.deltaTime really applies here. Time.detlaTime varies based on the render time of every frame, but this collision event only happens once per collision. This means the amount of motion you get will vary based on the time it took to render that specific frame.
If you’re not using a Rigidbody then you’ve got a Static (non-moving) collider. If you want to explicitly move a collider then you use a Rigidbody set to Kinematic. Of course, as always, feel free to ignore this and bypass physics by modifying the Transform in the hope of making it better.
thank you a bunch for the help i needed to 1 classify the pushDirection at the top of the code and call it using transform.Translate. you were right the Time.deltaTime wasnt doing anything.