how to make an explosion radius damage help?
CodeMonster
ACT, AustraliaMember Posts: 1,078
hello im trying to make it so if your in a certain distance of the bomb you will loose a life. i have no idea how to do this
Comments
Hi @CodeMonster using the vectortoAngle expression would help give you the result you want, but another way - much more straightforward - is to use an invisible actor centred on the origin of the explosion, collision shape set to circle, with a Collision rule.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
GSINVENTION FREE TEMPLATES
@CodeMonster No worries, just change the radius of the circle… although in this case, change the size of the damage area actor, for instance, when 100m away is safe, set the width and height of the bomb area actor to 199 pixels each, (or 396 if you want to double it, for instance, assuming 2 pixels for every metre, or whatever other ratio you want to use). A good thought but, for the record, just the x consideration wouldn't be enough, you'd need the Y position distance as well, to consider, but even then, that'd make the bomb area square…. hence the suggestion I gave of using vectortoAngle, then perhaps easier, an invisible circle actor & collision rule.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
GSINVENTION FREE TEMPLATES
GSINVENTION FREE TEMPLATES
GSINVENTION FREE TEMPLATES
My question was asking what is the purpose of constraining the radius/collision actor to the explosion/bomb actor, I'm not sure why you'd want or need to do this ?
It's just when the bomb drops from a box (this can be any box. It's random)
The bomb will fall hit ground. The bomb flashes them bomb! I made an actor constrained to the bomb. The actor being invisible and with a big size. So if the main actor collides with the constrained invisible actor when the bomb goes off. Loose life
@socks
GSINVENTION FREE TEMPLATES
For me personally I like to avoid unnecessary behaviours, attribute, rules and so on - so in this case I'd dump the attributes and the constrain behaviours and simply have the bomb spawn the collision actor when it explodes - I can't see any real reason to constrain the collision actor to the bomb.
Anyhow, if it works, it works ! >-
GSINVENTION FREE TEMPLATES