Game Development Community

Projectile Problems

by Ben Ewing · in Torque Game Engine · 04/24/2006 (7:09 pm) · 2 replies

Ok, Im having a bit of a problem with creating a projectile, and making go downwards, and what the rotation is doesnt seem to affect its direction, would anyone happen to know how to control that (the direction) :s
%p = new projectile() {
      dataBlock        = BasicOrb;
      initialVelocity  = $orbVelocity;
      initialPosition  = %orbX SPC %orbY SPC $orbHeight;
	  position = %orbX SPC %orbY SPC $orbHeight;
	  initialRotation = "1 0 0 90";
	  rotation = "1 0 0 90";
     // sourceObject     = %obj;
      sourceSlot       = 0;
     // client           = %obj.client;
   };

#1
04/24/2006 (7:48 pm)
There is no rotation values (assignable) on a projectile. Your initialVelocity is the direction as well as the speed it moves at. So a projectile that goes straight down, would have a intialVelocity of "0 0 -100", where as the last value could be changed to determine how fast it actually starts going. Gravity can be set to affect projectiles as well if you toggle their isBallistic and gravityMod parameters.
#2
04/24/2006 (8:00 pm)
:) Thanks Paul, I apreaciate the fast reply.