I’m working with two default PlayCanvas projects, first person movement and third person controller, while third uses rigidbody teleport to move and rotate player, first person movement does not, only forces (rotations only applied to camera), what I’m trying to do is to have first person movement logic inside third person controller, I’ve got it all working except for rotation, seems like setting eulerAngles or localEulerAngles has no effect on the rigidbody, any ways to rotate rigidbody without using teleport? Thanks
this.entity.rigidbody.syncEntityToBody(); + setLocalEulerAngles
This is the solution
Please note that what you are doing here is the same as
Got it, but this only partially solves the problem, when I use syncEntityToBody or teleport and the entity receives force, it somehow stops every few seconds, I don’t know what it depends on, but different computers give different time intervals before stopping, is there something to do with Ammo?
this.entity.setLocalEulerAngles(0,this.cameraScript.eulers.x + 180,0); force.set(x, 0, z).normalize().scale(this.strength); this.entity.rigidbody.applyForce(force); this.entity.rigidbody.teleport(this.entity.getPosition());
Bump, back to work after a break
Not sure what you are doing, but I think with line 4 you break line 3. Maybe you can change the order?