Behavior Request: Colliding
-
@Thecheater887 you could already do this! Without the behavior!
timer (every 0 seconds)
Get position (of selected object)
If (get position X > x)
If (get position X < y)
If (get position Y < z)
If (get position Y < n)
behaviors...The ifs set the object boundary.
They can be changed using "set input field" behaviors per moving object.
It's harder but it works! -
@GameCRAZY Thanks, but I need to be tag and loop heavy when using this in most cases, so having this for say 250 different object would bog down the project a LOT.
Additionally, I see "if"s like hammers.
A necessary tool, but deadly when misused. There it would be like giving 1000 three year olds hammers, letting the, loose, and expecting them all to behave and survive.
This for the suggestion though! I'll use it in smaller projects!
-
@Thecheater887 I'm using it for my level creator in my game. It's a pretty big scene and will be a huge system. Thing is, it isn't causing me any bugs.
It's hint you could still get what you want out of the sequence. If behaviors are one of the most important behaviors.
-
What device are you on? I'm on an older one, and any time I have 250 "if"s running, my game slows down to a crawl.
-
@Thecheater887 I'm on a first generation iPad Mini. I have tons of lag - but this isn't inluded in my list :)
-
@GameCRAZY I'm on iPad mini 2, and lots of lag as well, unfortunately, the ifs are on my list XD
-
If I understand your question, the simplest way to do this is to have an attribute with a default of 0 and when the objects collide set the attribute to 1 then when they stop colliding set it back to 0.
So, all you have to do is to get that attribute and if it is equal to 1 that means they are currently colliding!
Hope this makes sense, if you have any questions about this just ask! -
@iTap-Development ooh, I like that one... Works in most cases... Sounds so good... XD.
-
@GameCRAZY thanks! Just curios, you said works on most cases...what cases would it NOT work on? I'm not saying there aren't any!
-
@iTap-Development I'm not sure XD.