3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: iObjectLocationSet  (Read 1012 times)

« on: November 17, 2009, 05:42:25 PM »
I have the following script to set the position of a rigidbody and a skinmesh, which works fine if "working at start" is checked. I would like to run this script with an EventOnContact, but it doesn't seam to work. What am I doing wrong?



Vector3 ObjectLocation;

void Main()
{
   
      iObjectLocation(OBJ_0,ObjectLocation); // RigidBody
      iObjectLocation(OBJ_22,ObjectLocation); // SkinMesh

   
      ObjectLocation.z = -26.4936;
      ObjectLocation.x = -131.811;
      ObjectLocation.y = 18.1956;
     
      iObjectLocationSet(OBJ_0,ObjectLocation);
      iObjectLocationSet(OBJ_22,ObjectLocation);
   
}
« Reply #1 on: November 18, 2009, 08:38:22 AM »
Surely someone can offer a suggestion here. Is this even possible?
« Reply #2 on: November 18, 2009, 09:06:24 AM »
Try that:
Code: [Select]
void Main()
{
      Vector3 ObjectLocation = Vector3(-131.811,18.1956,-26.4936);
      iObjectLocationSet(OBJ_0,ObjectLocation);
      iObjectLocationSet(OBJ_22,ObjectLocation); 
}
Uncheck "Working At Start" for the script.

(I tested it with an eventonlocation and it worked fine...)
« Last Edit: November 18, 2009, 09:10:15 AM by IronF »
« Reply #3 on: November 18, 2009, 05:48:28 PM »
Thanks IronF that did the trick!
Pages: [1]