PDA

View Full Version : Event needed when object enters a "bag/deck" (not global).



francogp
07-06-2017, 05:41 AM
Hi,
I need an event that allow me to script something after AND before (2 events) an object enters a bag or a deck.
The event should be triggered on objects, not a global script.

For example, I need to script a bag, that when someone drop an object on it, the object goes automatically to the bottom of that "stack/deck". An event is needed for this purpose.

dzikakulka
07-06-2017, 08:17 AM
Current "global" event can also be put on any object script fine and you just need to ignore any case where "bag" object is not "self".

What "Stack" you do mean? You can't rearrange items in a bag anyway.

MrStump
07-06-2017, 09:08 AM
Using onCollisionEnter will trigger any time an object touches a bag. If you use getObjects() on the bag at that time, it will include the object that just entered the bag. Its not perfect but covers some use cases

francogp
07-06-2017, 09:16 AM
What "Stack" you do mean? You can't rearrange items in a bag anyway.
In cases of a deck. I need to put the first card on the bottom, in case that a user drop a card over that deck.