Game Development Community

Rigid Shape Class help Not Pushing but gravity works

by Sventhors · in Torque Game Engine · 08/21/2005 (9:53 am) · 1 replies

I have done Thomas "Man of Ice" Lund tutrioal and got the first part working. I have a boulder that rolls down a hill(yeah). I tried to add this script so I can push around the object. I put this on my server/script/player.cs

function Armor::onCollision(%this,%obj,%col)
{
	
if (%col.getDataBlock().getName() $= "BouncingBoulder") {
// Apply an impulse to the object we collided with
%eye = %obj.getEyeVector();
%vec = vectorScale(%eye, 10);

// Add a vertical component to give the item a better arc
%dot = vectorDot("0 0 1",%eye);
if (%dot < 0)
%dot = -%dot;
%vec = vectorAdd(%vec,vectorScale("0 0 2",1 - %dot));

// Set the objects position and initial velocity
%trans = %col.getTransform();

// Heres the position and rotation.
%pos = getWords(%trans, 0, 2);
%col.applyImpulse(%pos,%vec); 
}      
}

Nothing is happening. Do I need to put something else in or adjust it. Is this script correct? Can someone help me.

Also, when he says
Quote:Your DTS object is required to have a mass node, but nothing else.
What does it mean. Do I put a node in Maya when I create it?

#1
08/21/2005 (1:04 pm)
Try to scale it to a larger vector. Sometimes you actually push with too little force!

Re mass node. I dont know how Maya does it. In Max you need to add a node called mass