- Home /
Collision Boxes Aren't Working
hello sorry if i'm making a nooby mistake but iv'e tried all the types of collision boxes but they just wont work the player has a collision box on so i don't know whats going on do the objects need a script to stop the player from walking through them if they do could you help me please sorry if i'm doing something stupid.
Answer by hvilela · Sep 27, 2012 at 10:59 PM
When you just directly change the transform.position from a game object you're actually not moving it, you're kind of "teletransporting" it, ignoring all the physics. To move an object with physics you have to use MovePosition instead.
Answer by hvilela · Sep 27, 2012 at 09:05 PM
Do you mean that the player "kicks" the objects instead of block his movements? Mark "Is Kinematic" in the Rigid Body component of the objects that you want to be static. The question is a bit confusing, so I hope it's what are you looking for.
sorry if its confusing yes i want the object to block the players path but ins$$anonymous$$d the player just walks through
If the users "kicks" or "pushes" the objects, than kinematic is the answer. If he's passing though the object, you're doing something wrong.
yes i have tried rigidbodys but they also don't wok
Are you moving your player by manually change his position, like: player.transform.position = something?
If you're doing something like that, that's a mistake. It ignores the physics. Take a look at the CharacterController class.