Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[newton] Disable / move / enable newton vehicle #99117
11/17/06 23:15
11/17/06 23:15
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
HI

I need to know if there is a way of disable/pause for a moment a newton vehicle, give it a new position setting x/y/z coordinates and then reenable it again.

Thanks for any responses.

Re: [newton] Disable / move / enable newton vehicl [Re: Carloos] #99118
11/18/06 02:47
11/18/06 02:47
Joined: Mar 2005
Posts: 514
Brazil
Carloos Offline OP
User
Carloos  Offline OP
User

Joined: Mar 2005
Posts: 514
Brazil
Ok, never mind, find the solution...

I cancel the player controls and all the forces applied to the Newton vehicle.

Then I applied :

function teleport_me()
{
NewtonVehicle.carenginetorque=0;
While(NewtonVehicle.CarSpeed>0.001)
{
Wait(1);
}
reset_lock=1;
NewtonVehicle.x = 3000;
NewtonVehicle.y = 2412;
NewtonVehicle.z = 100;
var carbody;
dll_handle = newtonHandle;
carBody = NewtonGetBody (NewtonVehicle);
NewtonBodySetTransform (carbody);
reset_lock=0;
}

And it worked fine.

To use it, all you have to do is substitute NewtonVehicle in my code for the name of your Newton vehicle entity, and set your coordinates.

Last edited by Carloos; 11/18/06 03:02.

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1