Jump to content
Sign in to follow this  
Grumpy Old Man

Place Vehicle on its side - impossible?

Recommended Posts

Hey folks,

currently trying to place vehicles sideways, to no avail.

I've been using

[cursortarget, 0, -130] call BIS_fnc_setPitchBank;

to test various vehicles and they all seem to auto-unflip themselves.

I even tried to add enablesimulation false, didn't work at all.

Seems to be wonky physx handling from the game itself, if you try it you can even see the vehicles starting to dance around until they're unflipped.

This is driving me mad.

Any suggestions?

Share this post


Link to post
Share on other sites

I remember using setvectorUp for that purpose:

vehicle setvectorUp [0,1,0];

Share this post


Link to post
Share on other sites

There is also the setVectorDirAndUp command which may also be useful.

Dirty Haz

Update:

I have got it working with just BIS_fnc_setPitchBank. :)

Screenshot.

Dirty Haz

Edited by Dirty Haz
Update

Share this post


Link to post
Share on other sites

the setvectorup command is basically doing the same as the bis_fnc_setpitchbank

Vehicles will be on their sides for a split second, then magically bounce until they're on their wheels again for some weird reason.

The only workaround I can think of is to use setcenterofmass to shift the mass of a vehicle to the side it should be lying on, but it's not working as reliable as I want it to.

Share this post


Link to post
Share on other sites

Strange. I have got it working with just BIS_fnc_setPitchBank. :confused:

Dirty Haz

Update:

Name the vehicle, I have named it "car".

Put the below code in the vehicle init.

null = [] spawn {sleep 2; [car, 0, -90] call BIS_fnc_setPitchBank;};

Car now spawns on it's side.

I think this is what you are asking for / want. If not then my apologies! :)

Dirty Haz

Edited by Dirty Haz
Update

Share this post


Link to post
Share on other sites

Each vehicle in this screenshot was set with

this setVectorUp [1,0,0];

in the init of the vehicle.

2014_05_17_00001.jpg

Those that are upright I assume because the slope made them roll back over again.

Share this post


Link to post
Share on other sites

Apparently this command won't work as intended when using it on already existing vehicles mid-mission (just like I did when testing the command in the editor),

when putting it into an units init field or using it shortly after spawning the unit it's working just fine, all vehicles are sideways now, when using the command in my spawn scripts.

Very weird.

Share this post


Link to post
Share on other sites

I found that damaging the wheels of the car on the same side where the car will be resting helps to make it stay on its side.

Share this post


Link to post
Share on other sites

Have you tried dropping it from eg. 1 meter?

Sometimes a car flipped at 0m conflicts with terrain. At least that was my finding. I drop them and they stay flipped. Spawned cars.

Share this post


Link to post
Share on other sites

Just use enableSimulationGlobal and set it to false.

It will stop all simulations on the vehicle including physx.

Share this post


Link to post
Share on other sites

But this will make the vehicle indestructible, which is odd as long as it's not a wreck already. :/

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×