I’m a newcomer to the PlayCanvas community and I’m in the process of developing a game which uses a physics object to slide down a mountain. Ive been trying to apply certain amounts of force to parts of the object that would make it flip or turn and i have no idea how to accomplish this. Ive been working on this game with very little knowledge on coding and I’ve been taking classes to learn Java Script which will hopefully allow me to solve this problem. Does anyone know any form of solution to my problem?
To flip/turn the object it might be best to apply torque rather than a linear force. To do that you can use
yourEntity.rigidbody.applyTorque. If you wanna go with the linear option there’s
yourEntity.rigidbody.applyForce which can take two parameters, a force vector and a position at which to apply the force. Important to note is that both the force and the point of application are in world space. This means they’re unaffected by rotation/scaling applied to the object.