Jump to content
gc8

Gluing objects to terrain

Recommended Posts

Hi

is it somehow possible to glue objects to terrain so they wont flip over on hills? I spawn some stuff from composition and satellite dish or static weapons tend to flip over

 

thx!

Share this post


Link to post
Share on other sites

Maybe putting this in the object's init might help.  Will align object with surface slant.

this setVectorUp surfaceNormal position this;

Or, if the objects are just for eye candy, you could disable simulation on them:

this enableSimulation false;

Or, you can place as small object that won't fall over like a screwdriver object, then attach your larger object to the screwdriver.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@johnnyboy Thanks for those two commands, I used them both to make the object stick on the terrain. Looks bit funny to have the objects hang on mountain but I guess you cant have everything 🙂

What about static weapons, can AI use them if their simulation is disabled?

  • Like 1

Share this post


Link to post
Share on other sites

You can use the attachto with another object and hide the first object after.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Quote

What about static weapons, can AI use them if their simulation is disabled?

 

I believe so yes because there are scripts which attack turrets on vehicles and they still work. 

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, JohnKalo said:

I believe so yes because there are scripts which attack turrets on vehicles and they still work. 

 

I just tested this by placing turret with gunner in the editor and disabled the simulation of the turret (enableSimulation) and the gunner did not shoot nor could be killed.

Share this post


Link to post
Share on other sites
9 minutes ago, JohnKalo said:

 

I believe so yes because there are scripts which attack turrets on vehicles and they still work. 

That is true.  I have attached turrets to vehicles, and they still work.  I did this in JBOY_LongBoat.

  • Like 1

Share this post


Link to post
Share on other sites

Does anyone know how to check if the angle of the slope is too great for object placing?

Share this post


Link to post
Share on other sites
20 minutes ago, gc8 said:

how to check if the angle of the slope is too great for object placing? 

 

You can add to check the position before spawning with

https://community.bistudio.com/wiki/isFlatEmpty

and

https://community.bistudio.com/wiki/BIS_fnc_findSafePos

  • Like 1

Share this post


Link to post
Share on other sites

Have you tried Bob setVectorUp [0,0,0]; or Bob setVectorUp [0,0,1];

Share this post


Link to post
Share on other sites
2 hours ago, phronk said:

Have you tried Bob setVectorUp [0,0,0]; or Bob setVectorUp [0,0,1];

 

Yup, post #2

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

×