• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

If Other = a valid condition?

T

TinShigi

Guest
Hi! I can't get it to do anything so maybe it's wrong but it's also not giving me an error so I thought I'd come see if anyone knows for sure.

Let's say I have a parent for projectiles like par_projectile, and i set up a collision on the player specifically if the two meet, but I want the effect to be different on the player depending on what specifically that projectile that falls under that parent is.

So is the phrase "If other = obj_redbullet" a valid initial condition to place in the par_projectile collision or am I trying to force it to do something "other" isnt designed for?

E: Whoopsie I mean, I'm trying to use this condition on the player object, with the event "collision with par_projectile". Sorry I wasn't clear the first time! So other would mean whatever the projectile is hitting the player which would be different.
 

Nallebeorn

Member
No, other is a constant – it always has the value of -2, not the instance id or object index of the instance it refers to.
You'll want to do if (other.object_index == obj_redbullet).
 
T

TinShigi

Guest
Ohh okay. I didn't think it worked that way but I wasn't sure.. Thank you!
 
Top