How can i Animate the Static Shape - Door
by Balmer Steve · in Torque Developer Network · 07/05/2010 (5:17 am) · 3 replies
Hi All
I have an door. When the user clicks the door the door should open .
Door is an static shape . How can i animate the static shape.
when the door opens the player should enter the door and walks out.
How can i do it?
Any ideas welcome
Balmer.
I have an door. When the user clicks the door the door should open .
Door is an static shape . How can i animate the static shape.
when the door opens the player should enter the door and walks out.
How can i do it?
Any ideas welcome
Balmer.
#2
07/06/2010 (9:56 am)
Either animate your door shape in a modeling package and call the appropriate sequence in-game, or use script to rotate/slide (transform) the door out of the way -- several Resources exist here that use these methods.
#3
datablock StaticShapeData(Door)
{
category = "Doors";
shapeFile = "~/data/shapes/doors/door.dts";
};
function Door::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $="Player")
{
%client=%col.client;
%this.setActionThread("DoorOpening");
}
}
The above code is not working.
But when the Person Enters the Door . The Door Is not Opening.
What is the wrong in my code.
If i have assumed door as a static shape. The player enters the door.
because there is no collision or bounding box to prevent this.
only if the player clicks the door the door should open. or else the player should wait.
how can i set the collision to the static shape data.
Thanks in advance
Balmer
07/07/2010 (9:53 pm)
@Michael Hall Thank You For Your Reply. I have use the Following code for animate the Static Shape.datablock StaticShapeData(Door)
{
category = "Doors";
shapeFile = "~/data/shapes/doors/door.dts";
};
function Door::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $="Player")
{
%client=%col.client;
%this.setActionThread("DoorOpening");
}
}
The above code is not working.
But when the Person Enters the Door . The Door Is not Opening.
What is the wrong in my code.
If i have assumed door as a static shape. The player enters the door.
because there is no collision or bounding box to prevent this.
only if the player clicks the door the door should open. or else the player should wait.
how can i set the collision to the static shape data.
Thanks in advance
Balmer
Balmer Steve