☑ Trigger question

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?


Ok i removed the rigidbody and i have this code

        onCollisionStart: function(result) {
            if (result.other.getName()==='Player') {
                if (this.iconWater===false) {
            } else {
                if (this.iconWater===true) {

but doesn’t work

Re-check the tutorial, the events are different for triggers.

:stuck_out_tongue: 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 :slight_smile:
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 :stuck_out_tongue: 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 :slight_smile: