Game Development Community

Attatching Particles

by Sam Guffey · in Torque Game Engine · 09/01/2002 (6:46 am) · 2 replies

How would I go about attaching particles to an object like a player. I seen somewhere that there was a light that could be attached to a projectile so I didnt see why we couldnt do particles as well, just dont know where to start. Reason Im asking is, if you have ever created a particle on a player it stays in the same position, sure I could create a loop but that would be like doing a mod and it would look bad. Any imput would be appreciated.

#1
09/01/2002 (3:48 pm)
Perhaps keeping something attached like that might be similar to the weapon images that track the player?
#2
09/01/2002 (10:49 pm)
Sam, yeah, Max is on the right track...
I've done this by generating a "dummy" Item (using some "empty" DTS shape) class which only purpose is to emit particles... you can attach the Item to any node on the player (maybe add a custom node for that), and the Item then emits the particles...
it seems to be impossible to attach particles to the player object itself (you'd have to code that), so that's the easiest way to do, I guess...
I've used the weapon slot for my example, and I mount/unmount it like any other weapon...

// mount
	%this.auraEmitter = new Item()
	{
		dataBlock = LostSoul;
	};
	%this.pickup(%this.auraEmitter,1);
// unmount
	 if(%client.player.auraEmitter !$= "")
	 {
		 %client.player.decInventory(%client.player.getMountedImage($WeaponSlot),1);
	 }
	 %client.player.unmountImage($WeaponSlot);