Passing through static bodies

Hy guys, i`m trying to create a wall and a floor, but when i take my caracter and move in the direction of this walls and another objects, he’s passiing through, how can i block this “passing” ?

My guess (without seeing the project) is that the character has no rigid boy or there’s been an error in the setup or the character is being moved with setPosition rather than with forces which means that the graphical representation is being moved but not the rigid body.

1 Like

oh sorry, my project is https://playcanvas.com/project/567248/overview/teste is there a tutorial where i can see about rigid body ? thanks for the reply :smiley:

Try this on your console:

pc.app.root.findByPath('Root/Plane').setPosition(0,0,0);
pc.app.root.findByPath('Root/Plane').collision.enabled = true;
pc.app.root.findByPath('Root/Playbot').rigidbody.teleport(0,10,0);
pc.app.root.findByPath('Root/Playbot').rigidbody.bodyType = 'dynamic';
pc.app.root.findByPath('Root/Playbot').findByPath('Camera').lookAt(pc.app.root.findByPath('Root/Playbot').getPosition());

You will find playbot and ground collision correctly except the strange relative positions of playbot and it’s camera.

Keep collision and rigidbody components both be enabled on your entity, to get result expected.

If you want to know more about the first-person movement, refer to this tutorial.
https://developer.playcanvas.com/en/tutorials/first-person-movement/