1 decade ago
by Juls
I'm looking for a way to get an event that is raised when I loose contact with an entity. For example, player opens a treasure chest and upon moving away from the chest I would like to make the chest close.
I know this could be done other ways as well but in general an event loosing contact with XX would be helpful.
Any ideas on how to implement this?
1 decade ago
by Joncom
How about maintaining an array of entities in contact with the current entity. On each update, check if these entities are still in contact. If not, call the event and remove the entity from the array.
1 decade ago
by Apiheld
Idea1: Calculate the distance between the player and the chest and store it. In the next frame, calculate the distance again. If the distance is > THRESHOLD && distance > lastDistance, then close the chest.
Idea2: Make triggers (see Biolab entity pack) and place them around a chest. Then you could try to chain triggers and make some sort of check: If player has contact with outer trigger, close chest. If player has contact with inner trigger, open chest.
Page 1 of 1
« first
« previous
next ›
last »