Imported Character Asset Strange physics with objects

So I was working on my game and enemies move towards my cube character I made. Everything works fine until I tried to import a pre made character, but for some reason, the enemy objects now bend down and act weird near this downloaded character, I have tried locking every axis and setting to Kinematic to true. Nothing changes

Any help would be appreciated!

Player and enemies have box colliders etc


Are you using some kind of Look at function? If so, your enemies might be looking at your character position (= transform.position). Usually, characters use transform.position = feet position.

Here is a simple look at function (i’m using "forward = " because i’m lazy):

Vector3 lookAt = target.position - transform.position;
transform.forward = lookAt;

The trick is to remove the y component of your “look at” vector:

Vector3 lookAt = target.position - transform.position;
lookAt.y = 0f;
transform.forward = lookAt;

This will only work if up = Vector3.up. If you want a more general purpose look at relative to the character upwards direction:

Vector3 lookAt = target.position - transform.position;
lookAt = Vector3.ProjectOnPlane(lookAt, transform.up);
transform.forward = lookAt;
1 Like

I

Hey yeah I am using a look at

Yeah it was the look at function, that was an incredibly annoying problem, thank you so much! I can’t believe that one line of code screwed it up so badly, I had ruled it out becuase my original character wasnt effected by this

1 Like