Particle Emitter Issue
CircleBoxStudios
Member Posts: 22
So I have my actor riding a motorcycle. I would like this smoke particle effect to come out of the exhaust pipe.
I have the particle effect all set up. The Offset is -45,5 when at a 0 rotation. I have put together this in the velocity/direction section for the offset... -45*cos(self.rotation) and 5*sin(self.rotation). The direction is set to 160 so it floats out and away. I have checked rotation and it is proper. I can't figure out why the offset is not working. When he is tilted at 330 degrees it is emitting it from the back wheel.
Any ideas?
I have the particle effect all set up. The Offset is -45,5 when at a 0 rotation. I have put together this in the velocity/direction section for the offset... -45*cos(self.rotation) and 5*sin(self.rotation). The direction is set to 160 so it floats out and away. I have checked rotation and it is proper. I can't figure out why the offset is not working. When he is tilted at 330 degrees it is emitting it from the back wheel.
Any ideas?
Best Answer
-
Socks London, UK.Posts: 12,822
@Socks The actors size is 100x76. -45 and 5 is the position relative to this actors center that I would like it to be coming from.
Ah ! I see what you mean now. >-
If you want the place where the particles are coming from to keep still / not move (in relation to the actor), then the cos and sin values need to be the same.
Check out this thread, it might help . . .
http://forums.gamesalad.com/discussion/62202/linkmachine
. . . . you can convert those values to particle offsets, they don't need to be constrain behaviours, they are basically X and Y coordinates (and you won't need the third constrain rotation behaviour, ignore it with what you are doing).As the actor rotates I would want the particles to continue coming from the same placement relative to the image. So if at 0 rotation it would be coming from the left side. When at 90 degrees it would be coming from the bottom of the graphic. Does that make it clear at all? ... I hate all this angle talk. I despised geometry.
Yes, that's make perfect sense.
The way you have it set up the sin and cos need to be the same, they are just the 'radius', the distance from the centre of the actor - if they are not the same they will go 'weird' (technical term) when your actor rotates. I know you have a slight vertical offset of 5, this needs to be achieved by adding it to the sin/cos angle rather than to the sin/cos radius. And I wouldn't bother with -45, I'd just go with 45 and then add the minus bit into the angle . . . .
So, something like this:
45*cos(self.rotation+180)
45*sin(self.rotation+180)
You might not want it to go a full 180° as you want that little '5' vertical offset, so if you image moving 180° is like going from 3 o'clock to 9 o'clock, then instead let's go from 3 o'clock to 10 o'clock . . . .
45*cos(self.rotation+165)
45*sin(self.rotation+165)
And now that we've rotated back by a few degrees the x position is no longer exactly 45 pixels from the centre (imagine the tip of a clock hand, as it moves from 9 to 10, the tip of this clock hand's x position moves a little to the right) . . . . so increase the radius a little compensate . . .
50*cos(self.rotation+165)
50*sin(self.rotation+165)
. . . . etc etc . . . (I've just used arbitrary / random values for illustrative purposes)
P.S. this is trigonometry not geometry )
Answers
Any suggestions?
Your question is not clear ? "-45*cos(self.rotation) and 5*sin(self.rotation)" (I am going to presume X and Y) will give you a very flat ellipse, so as an object rotates (the object emitting the particles) the place where the particles come from will move up and down relative to that object. Generally speaking the X and Y (cos and sin) positions would be the same.
Why have you chosen -45 and 5 ?
Also, yes, my bad it is trigonometry lol.