Game Development Community

Particles not aligned

by Backman · in Torque Game Builder · 10/18/2008 (12:14 pm) · 4 replies

My particles don't align properly to their direction. The ones going straight upwards and downwards align as expected but the ones traveling straight left or right have been rotated 180 degrees the wrong way. Anything between is obviously more or less working or not depending on how close to those two directions the sprite is.

To fix this I'd need to invert all sprites on their X axis (screen coords), how can I do this? I'd rather not do this in code as I've seen this before and hope it's just something I do wrong.

Thanks for any help!

#1
10/18/2008 (3:26 pm)
Function t2dParticleEffect::adjustTracks(%this, %player)
{
%TrackEmitter = %this.findEmitterObject("UntitledEmitter");
%TrackEmitter.setFixedAngleOffset(-%player.getRotation());
}

This is what I did in a game once. It must be called onTimer or something similar because of its nature. Someone more knowledgeable than I will have to tell you how to do it with the LB
#2
10/19/2008 (3:20 am)
Thanks, I should look into what I can do in code more.. That however is assuming your particles are attached to a player right?

My particles come out in a 360 degree range from a point that just sits there in the middle of the screen. I'm basicly doing one of those cheezy star fields but want my particles to all point forward in their own direction.
#3
10/19/2008 (5:19 am)
Yes, it was attached to the player and it also emitted only once every 4 seconds.
#4
11/06/2008 (12:42 am)
Cheers Kevin, I see where that would work but don't think it'd help in this case? You're using a fixed angle as well and I'm looking for the particles to come out at any angle depending on their own path.

To clarify - basicly I just want an emitter in the middle and all particles coming out of this object, emitter angle set to 360, and moving straight away from it facing away from the middle. An explosion if you will, but all particles facing their own forward direction.

Is this actually possible?

My fix for this would be loads of emitters with an emitter angle set to something really small and these emitters would form a circle all facing away from the middle. Not very nice to work with tho. :(

Thanks again.

P.S Sorry for posting in the wrong forum, must've just not seen 'particle system' when I created the thread. Feel free to move. :)