Constrained killzone
B1984
Member, PRO Posts: 91
hello,
I have a 306x8 actor that will be an obstacle/spike in my game. I only want the bottom 8px to destroy the player, the rest is non-lethal. I tried to constrain self.size.height/.9.8, but my main character is destroyed as soon as I spawn.
This is how it looks:
Game attributes:
Spike real
Spike attributes
Constrain attribute self.size/height/.9.8
Character attributes
rules
collision or overlap with actor spike
do= destroy
Any suggestions? Thanks in advance.
I have a 306x8 actor that will be an obstacle/spike in my game. I only want the bottom 8px to destroy the player, the rest is non-lethal. I tried to constrain self.size.height/.9.8, but my main character is destroyed as soon as I spawn.
This is how it looks:
Game attributes:
Spike real
Spike attributes
Constrain attribute self.size/height/.9.8
Character attributes
rules
collision or overlap with actor spike
do= destroy
Any suggestions? Thanks in advance.
Comments
That's the actual formula I'm using from jamie's tutorial "Gamesalad Recipe 003". He only needed the top of an enemy's head as the safe zone for killing the enemy, but I want the the shaft of a spike to be safe and the tip be the destroy zone.
Thanks for any help.
EDIT: The correct answer was (self.position.y)-((self.size.height)/2)