Hello, i want to make a trigger but if i use a static rigidbody it don’t work, if i use a kinematic the player stop before colliding (due to my code) and dynamic would be the same…how can i solve that?
Erm… Triggers don’t have rigidbodies so I’m not sure exactly what you are asking or what the problem is?
http://developer.playcanvas.com/en/tutorials/collision-and-triggers/
Ok i removed the rigidbody and i have this code
onCollisionStart: function(result) {
if (result.other.getName()==='Player') {
if (this.iconWater===false) {
this.createIcon();
this.iconWater=true;
}
} else {
if (this.iconWater===true) {
this.clear();
this.iconWater=false;
}
}
},
but doesn’t work
Re-check the tutorial, the events are different for triggers.
yes i have seen this this.entity.collision.on(‘triggerenter’, this.onTriggerEnter, this);
but this don’t work result.other.getName() so have to check the documents…will let you know in a short while
got it
onTriggerEnter: function(entity)
and the difference is that entity refers to the object that enter the trigger space instead for rigidbodies collision is result.other to refer the other object aww not good to want make things fast you miss details Thanks @steven
Ehm sorry to revive this topic, how do i check the triggerleave event? I haven’t found an example
Already found out…never mind