Error loading particleeffect. Cannot Load-Effect; not in a scene
by Jon Mitchell · in Torque Game Builder · 12/28/2006 (5:00 pm) · 2 replies
I am experimenting with the shooter tutorial, I have only added the movement and fire functions, I am trying to add a jet effect when a directional key is presses. The call from the key being presses is working, but when I try to launch an effect I get an error that I list below. I tried digging around in the forum and best I can tell the way I have set up the function to load the thruster seems to be the same as others I have looked at.
t2dParticleEffect::loadEffect() - Cannot Load-Effect; not in a scene!
test/gameScripts/player.cs (0): Unknown command playAnimation.
Object (2843) t2dParticleEffect -> t2dSceneObject -> SimObject
here is the code I am using
Sometimes I make really simple mistakes that can take days for me to pick up on, chasing the missing semi-colon as it were. Does anyone see anything glaringly wrong with how I have set this up?
Thank you!
t2dParticleEffect::loadEffect() - Cannot Load-Effect; not in a scene!
test/gameScripts/player.cs (0): Unknown command playAnimation.
Object (2843) t2dParticleEffect -> t2dSceneObject -> SimObject
here is the code I am using
function thruster()
{
%thruster = new t2dParticleEffect() { scenegraph = t2dSceneGraph; };
%thruster.setPosition(pShip.getLinkPoint("1"));
%thruster.loadEffect("~/data/particles/jet.eff");
//%thruster.setLayer(15);
//%thruster.setSize ("8 4");
//%thruster.setLifeTime( 0.1 );
%thruster.playAnimation();
}Sometimes I make really simple mistakes that can take days for me to pick up on, chasing the missing semi-colon as it were. Does anyone see anything glaringly wrong with how I have set this up?
Thank you!
Torque Owner Stanley D Chatman
new t2dParticleEffect() { scenegraph = SceneWindow2D.getScenegraph(); };You are using Playanimation it should be PlayEffect
Also you have the function name same as the local variable (thruster). You might want to consider renaming one for clarirty in your code.