How to "When colliding" + Emitter Offset
gyroscope
I am here.Member, Sous Chef, PRO Posts: 6,598
Hi, I've a virtual joystick control (courtesy of Tshirtbooth) moving my player around, + revolving it based on the position of the joystick in a circle; it's a top down game.
When the player hits a wall, I'd like a short shower of sparks to be emitted from the point on the circular player that hits the wall.
I have two problems I can't solve:
The first is that the way I've tried to have the particles emitted only when the player hits the wall doesn't work; on pressing Preview, the particles happen straight away.
This is what I've got in the player:
Bounce when colliding with actor of type Wall
Change attribute, self.Hit Wall To true.
Rule: When self.Hit Wall is true
The particles stuff
Timer: After 1 second, Change attribute self.Hit Wall to false.
But as I say, even with Hit Wall starting out as false, the particles start straight away.
The second problem is that I would want the particles to emit from the hit point on outside the circular player. So although I've got them nicely emitting randomly from the centre of the player with random (0,360), I don't know what to put in the Emitter Offset x,y fields in the Velocity/Position tab. I'm guessing that it's be the opposite of vectortoAngle somehow, with half the width of the player thrown in somewhere...
If anyone can help with these 2 probs I'd be most grateful, thanks.
Edit: thinking the 2nd prob through more, I'm guessing that it's not possible, because it's nothing to do with vectors, or angle, but a collision point on the circumference of the player, which there's no way to get. So I'll stick with the particles emitting from the players centre, that's OK.
Any help with the particles on collision only, would still be appreciated, cheers!
:-)
Edit again: a sort of tunnel vision, I get, working with GS; sometimes the most obvious of things elude me; can't see the wood for the trees; ah, you get my point!
Put the Particles Behaviour in a Rule When Actor receives event, overlaps or collides with wall, then the particles.
So done it again, asked too soon; but maybe my thought process as a post might help someone somewhere sometime, at least.
When the player hits a wall, I'd like a short shower of sparks to be emitted from the point on the circular player that hits the wall.
I have two problems I can't solve:
The first is that the way I've tried to have the particles emitted only when the player hits the wall doesn't work; on pressing Preview, the particles happen straight away.
This is what I've got in the player:
Bounce when colliding with actor of type Wall
Change attribute, self.Hit Wall To true.
Rule: When self.Hit Wall is true
The particles stuff
Timer: After 1 second, Change attribute self.Hit Wall to false.
But as I say, even with Hit Wall starting out as false, the particles start straight away.
The second problem is that I would want the particles to emit from the hit point on outside the circular player. So although I've got them nicely emitting randomly from the centre of the player with random (0,360), I don't know what to put in the Emitter Offset x,y fields in the Velocity/Position tab. I'm guessing that it's be the opposite of vectortoAngle somehow, with half the width of the player thrown in somewhere...
If anyone can help with these 2 probs I'd be most grateful, thanks.
Edit: thinking the 2nd prob through more, I'm guessing that it's not possible, because it's nothing to do with vectors, or angle, but a collision point on the circumference of the player, which there's no way to get. So I'll stick with the particles emitting from the players centre, that's OK.
Any help with the particles on collision only, would still be appreciated, cheers!
:-)
Edit again: a sort of tunnel vision, I get, working with GS; sometimes the most obvious of things elude me; can't see the wood for the trees; ah, you get my point!
Put the Particles Behaviour in a Rule When Actor receives event, overlaps or collides with wall, then the particles.
So done it again, asked too soon; but maybe my thought process as a post might help someone somewhere sometime, at least.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Comments
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps