|
Post by TinSoldier on May 20, 2016 6:26:13 GMT
so i want to move ( teleport) a car (the player) from one location to another.
I can do this with iObjectLocation() commands buuuut
The car when moved gets thrown all over the place and i cant see why that happens.
Basically what i'm looking for is a teleport script that can move a car object from one point to another without the car flopping all around and being thrown into the air.
I've tried iObjectStop() but this doesn't seem to stop the engine physics ..
Anyone got a script i can test out ?
PS i came across a script a long time ago called teleport, but it use's skinmesh and works just fine, if i replace the skinmesh with a car object.. the car physic's don't teleport so smoothly... the car does teleport but bounces around and flips and just looks goofy .
One process that works perfectly is using the iObjectReset() but it also puts the car object back to its default start position which i don't want.
A scripted iObjectReset() with definable locations and orientations should work but would need to be tested.
If a car was in a closed box that has collisions with the car and it cant drive out, but the teleport script moves the car outside the building would do the job i think.
It's kind of weird that 3drad doesn't come with a teleport object to move anything to anywhere as if the object was reset but at the new location, seems like a useful and maybe even often used object or script for that matter.
|
|
|
Post by TinSoldier on May 20, 2016 22:04:34 GMT
Welp i found the solution, and it turns out to be really simple and works perfectly. Why i was having a problem still has me wondering.. but anywho. This is the required script to teleport / spawn / warp to a location. Vector3 ObjectLocation; Quaternion ObjectOrientation;
// OBJ_0 = skinmesh warp-to location // OBJ_22 = car / rigidbody / object to " warp , teleport or spawn " // Also uncheck "[ ]working at start" // The process here is to use an event object to trigger or start the Warp script which stops it's self when done.
void Main() { // get skinmesh location iObjectLocation(OBJ_0,ObjectLocation);
// get skinmesh orientation iObjectOrientation(OBJ_0,ObjectOrientation);
// relocate warp / teleport or spawn the object to the skinmesh location and orientation iObjectPositionReset(OBJ_22,ObjectOrientation,ObjectLocation);
// stop the script so it can be restarted / triggered again as needed iScriptStop(); }
This script piece came from the HuntSpace 3D website which has a 100 atleast projects / scripts to download and play with. The source file for this script piece is www.huntspace.com.au/3D/download.php?file=online/3DRAD_ProjectFiles/Spawn%20System.3drAnd thankyou to whoever wrote that script, it does the job perfectly and it's small and simple.
|
|
|
Post by Power Supersport on May 21, 2016 9:46:27 GMT
I was just going to answer you... For cars, you have to use the iObjectLocationReset() or the iObjectPositionReset()... I had the same problem with cars... When you use the normal iObjectLocationSet() it sends your car in the air...
|
|
|
Post by TinSoldier on May 21, 2016 18:10:05 GMT
Ahh so it's that issue, i wasted so much time trying timers and moves in steps etc with nothing fixing the problem.. and all i had to do was use the proper script command
|
|
|
Post by Power Supersport on May 21, 2016 18:15:16 GMT
Sometimes the answers are just that simple... While we try so hard to find them...
|
|
|
Post by Famer on May 23, 2016 14:39:40 GMT
This can be achieved without a script. 1. You select the location where you have to teleport the car.(you should know the location in metres value like XYZ position) 2.Add a GUI window and link it with the car and uncheck the working at start option. 3.Add an event object (any based on what occasion) and link it with the car and the GUI window and the objects that are involved in the event. 4.Set the GUI window objective for the car to ORIENTATION. 5.Set the event object's objective for the GUI window to START ON (SOMETHING). 6.And now play the game. Good luck!
|
|
|
Post by rock on Jun 1, 2016 12:47:08 GMT
|
|