Strange Movement With Trigger Colliders

Hi everyone. I’ve looked everywhere and can’t find an answer, so thought I’d come here:) I have a top-down, click to move script for my character. I use a character controller for movement. Everything works completely fine, until I click on a trigger collider. I placed a crate in my scene. I have a trigger collider to begin an interaction when the player is within the collider. When I click on the crate to move to it, the character moves to it, but when it hits the trigger collider, the player turns around in the opposite direction and runs away from it. Looks funny, but not what I want. Thanks for your help!

Since you post no actual code to comment upon, to help gain more insight into your problem, I recommend liberally sprinkling Debug.Log() statements through your code to display information in realtime.

Doing this should help you answer these types of questions:

  • is this code even running? which parts are running? how often does it run?
  • what are the values of the variables involved? Are they initialized?

Knowing this information will help you reason about the behavior you are seeing.

1 Like