Mount and Unmount from Chair Problems
by Britt Scott · in Torque 3D Beginner · 10/27/2012 (7:20 pm) · 2 replies
Problem is I've forgotten the difference between variable types in T3D. I'm thinking that's why the player will mount, but won't unmount.
Also, is mountPose the proper way to play an animation on a non-vehicle shape?
Shape's script:
Server script:
Thanks!
Also, is mountPose the proper way to play an animation on a non-vehicle shape?
Shape's script:
datablock StaticShapeData(RockingChair)
{
shapeFile = "art/shapes/RockingChair/RockingChair.dae";
category = "AnimatedObjects";
className = "RockingChair";
mountable = true;
mountPoint = 0;
numMountPoints = 1;
mountPose[0] = sitting;
};
function RockingChair::onAdd(%this,%obj)
{
%obj.playThread(0,"ambient");
}Server script:
function RockingChair::onCollision(%this, %obj, %col)
{
if (%col.getState() !$= "Dead")
{
warn("Rocking Chair Collision");
%obj.mountObject(%col, 0);
%this.schedule(3000, unmount);
}
}
function RockingChair::unmount(%this, %obj, %col)
{
warn("Player unmount");
%obj.unmountObject(%col);
%col.setTransform(%spawnPoint);
}Thanks!
About the author
Attended Brown College in Mendota Heights, MN for Game Design and Development. Projects include the Mech Starter Kit and the Battle Frog. Currently working toward a game design career.
Torque Owner Daniel Buckmaster
T3D Steering Committee