Game Development Community

Particles on cloned objects problem *SOLVED

by Adam Griffiths · in Torque Game Builder · 03/11/2008 (4:40 am) · 1 replies

Hello, I'm trying to work out how to shoot a laser beam effectively. I've got a sprite and when the player shoots i've got it shooting a clone of the sprite which works fine. However, because it's a clone it means that the mounted particle effect isn't being displayed, it's only displayed on the sprite out of sight of the camera.
I've tried mounting the particle effect to it after the clone is created also but it throws up an error that it's not in the scenegraph and so therefore cant display the effect.
I think it might be because i'm trying to follow code from elsewhere which is for older versions and i'm not sure how to make it be within the scenegraph. Can anyone help me out?
The particle effect is created within the level.t2d
The player clicks the mouse down, cloneWithBehaviours makes a projectile, position, rotation and velocity are set.
Then try and mount the particle effect to the projectile.

Or is there a way to just shoot the particle instead and i've been a bit silly? :D
The rotation is important though as i have 360 degree shooting arc.
Thanks in advance to anyone who can point me in the correct direction!

#1
03/13/2008 (4:37 am)
Okay, I've just solved my own problem so I thought i'd better post just in case someone else is as dim as I am!

Basically my problem as above was where if you cloned an object it wouldn't clone the particle that was mounted onto it either. Very simply, don't have the particle effect mounted in your level.
Instead after the cloned object is created, clone the particle effect in exactly the same way.
Then just use the mount command to mount the cloned particle to the cloned object.
In this way you can have fancy bullet streams, laser beams, comet trails, whatever you want.

I know, reading back now I feel a bit stupid but at least its solved now lol!