difference between....

Hello to all Unity community !
First of all, i must say am pretty noob at using unity, tho i’m an experienced programmer. And i must also say that when i first discovered unity, i could not believe my eyes !
So, BIG CONGRATZ for all this great job!
I didn’t read much in the different threads of this forum, but it seems there’s also a lot to learn over there. and as i didn’t find any answer to my question, i come for a new topic. Here’s my problem:
I started with the island demo, that i modified a bit. and i got a ‘walking’ object containing a rigidbody and a collider, and that i move with some translate and rotate functions ( booo i now know that it’s a mustn’t do :sweat_smile: ).

However, tho this object moves erratically on another object ( like a cube with rigidb collider ) it moves perfectly on the terrain ! :shock:

Wich means there’s a difference of handling colliders for terrain and other objects. Could anyone please explain me this difference. I’d just want to know before i rewrite my whole JS for using forces instead of movements.

Thanks a lot for your answers.
Best regards.

Use forces applied to the rigidbody instead of Translate, else it will lead to shaking movements.

:? thanks but this was not the question, and i already know this.

Is the terrain flat ? If yes, of course, there is “no” problem.

The problem when moving a game object with a rigidbody and a collider by Translate is that the function ignore collision. Translate do not “push” the game object towards the destination, it “teleport” the game object. Upon arrival, if there is a game object, you are sure to get a mess.

Mess that would have been avoided by using AddForce. Unity will use the physics properties, and make all tests to ensure it won’t go in a collider (unlike Translate).

Is that what you wanted to understand ?

You can try rigidbody.MovePosition instead. This is similar to directly translating, but takes collisions into account properly.

–Eric

ok ok. i solved the problem…