Hey guys today i found out that collider is not moving with an animation, is there a way to tell collider to follow
those rollers have animated path
Hey guys today i found out that collider is not moving with an animation, is there a way to tell collider to follow
those rollers have animated path
Unfortunately, no. Physics would be based on the entity position, not the mesh/animation.
If the colliders are just triggers, you could update the position and rotation on every frame based on the bone/node position of the mesh of the animation.
Yes they act as triggers, is there any topic related to this? I never tried tried it . I found only this scene where it is done but i dont understand what is nodeName
which is MaleBaseMesh:LeftHand
No tutorial on this.
You would work which graphNode in the hierarchy at runtime is the one animating. Use findByName on the entity that is animating and get the graphNode. Then you can get the position and rotation of the graphNode
MaleBaseMesh:LeftHand
is simply a name of the bone of the armature in that model. You can name the bones in your 3D modelling software and then address them as graph nodes in Playcanvas:
Okay nice thanks, so will the box with collider follow the bone if i set it up through code?
Yes, if you add your box entity with the collider as a child to that bone node. Just make sure to avoid adding a rigid body to that entity unless you are using a kinematic object and you know what you are doing with that.
Thank you so much Its going to act as a trigger so there is no need to add a rigidbody
this.entity already has a parent so you can’t use addChild.
Use reparent instead.
this.entity.reparent(this.nodeToFollow)
Yes i found out thank you