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
gyroscopeI am here.Member, Sous Chef, PROPosts: 6,598
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.
@gyroscope thanks for your reply except the explosion areas can be random so i cannot have a circle area unfortuantly like how can i make it so if its example like 100m away from bomb your safe?
gyroscopeI am here.Member, Sous Chef, PROPosts: 6,598
edited November 2013
@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).
If player position X is > + / -100 bomb position X then (...)
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.
@gyroscope thanks for your reply except the explosion areas can be random so i cannot have a circle area unfortuantly like how can i make it so if its example like 100m away from bomb your safe?
Gyroscope's circle actor / collision shape is the easiest, fastest, most flexible way to do this as far as I can see, you can of course make the circle any size you want, so if you want the 'explosion radius damage' to extend 100m in all directions then make the circle 200m wide.
hi all @socks and @gyroscope im still very confused because what happens is you jump up and hit a box, if your unlucky that box will drop a bomb this bomb will animate then animate a bomb explosion, so how can i constrain an invisible massive actor to the bomb actor thats being spawned then? im confused
Where would you put the middle of the explosion circle then?
I'm not sure what you mean by this question ?
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 ?
Well it all works fine. 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
If it works for you then that's good ! (and the most important thing !)
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.
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.
@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.
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
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 !