-
1 Attachment(s)
Not Overlapping Problem
Hello,
I'm having an issue with behaviors and not overlapping.
What I have is a player, then other actives. When the player is not overlapping an active, one of the active's flags is to be turned on. The problem is that the flag is being turned on for all of the object at a time, not independently for each one, as the behavior would suggest.
How can I get this to work?
-Eliyahu
Attachment 5271
-
It's working as intended... Think about what you are doing... You are running a condition to see if the active object (any of them) are not overlapping the player. Of course when the player moves away from the one active, both change, because neither of them are overlapping the player.
You would need to establish a connection between the player object and the active that it's currently overlapping first. That way you can check that particular object after the player stops overlapping it, instead of checking all of the actives when they aren't overlapping the player.
-
But I am doing it within a behavior so the only active being selected should be itself.
-
1 Attachment(s)
-
That does the exact same thing that mine does....and it's still a problem. Perhaps I should clear up my goals.
In my game the player goes through doors, and when you do, you are spawned in front of another door. I don't want to the player to be able to go through the door they just spawned at until they leave it. Meaning you can't just stand there pressing up repeatedly to teleport back and forth really fast.
-
The MFA you provided was checking for an internal flag on but not for off? So the frame change meant nothing which is why it didn't present a change in animation...
Also for the door situation, why can't you just use what you already have and put a 'Restrict Actions For' condition on there?
In one of my latest games there is a switch you can just walk up to and when you collide with it it activates the lasers, when you deactivate it; ditto for the lasers. This is set to a 0:0:10ms restriction and works perfectly fine with multiple lasers.
-
I would use different doors,..meaning door 1, door 2, door 3 and so on and use values. If player is facing direction (whatever) and goes through door 1, set value to 2,..then door 2 would be available and not door 1 any longer. Or upload your mfa here to let us take a look so we can fix/help you. Kind of hard to know exactly what you're looking for without seeing it.
-
Multiple doors? That's insane. I'm loading my levels externally so there will be a variable number of doors. Each door has a number, the number of the dungeon it cooresponds to, and its destination door's number.
And DannyC it SHOULD only check for being on. Restrict Actions could work, and I had it working, but I dont care if the player waits 10 seconds, I want them to have to leave the door and not be overlapping it for any instant before they can come back and go through it.
EDIT (SOLVED): I got it working! What I had to do was at the start of the frame set the doors the player was overlapping to have some flag on, then use that flag to test for not overlapping later.
-