Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Taylor1984

Place MG same height as unit

Recommended Posts

Hi!

 

I'm teleporting a static MG in front of a unit after using an action command. Problem is that if the unit is standing on a rock, house floor, mound or something else that's higher than the ground the MG gets placed on the ground and not at the same height as the unit. I guess the solution is something to do with select 2?

 

Thanks

Share this post


Link to post
Share on other sites

How do you teleport your unit? Usually the position is on ground and not on a rock, "invisible" for positioning commands (setPos family).
Try with vehicle unit. This way, you'll teleport the MG and its "crew".

Share this post


Link to post
Share on other sites

Sounds to me like it's just falling to the ground.

Unless there's a way to disable physics without using  enablesimulation which won't work if your going to get in the MG you may have to use the attachto command.

 

You just place an object such as flag pole on the map anywhere, name it pole then after you've moved the gun to the new position  attach it to the pole.

gun attachto [pole];

 

Share this post


Link to post
Share on other sites
7 hours ago, pierremgi said:

How do you teleport your unit? Usually the position is on ground and not on a rock, "invisible" for positioning commands (setPos family).
Try with vehicle unit. This way, you'll teleport the MG and its "crew".

I use the setpos command, yes, and getpos to the unit. Shouldn't there be a way to getpos the unit's height and transfer that to the MG? I've noticed that if I setpos a unit into a house with an elevated floor the unit will automatically land on top of the floor, shouldn't there be a way to do the same for other objects like the MG?

7 hours ago, fn_Quiksilver said:

modeltoworld [0,1,0]

Thanks, I tried using it but I don't really understand how it works.

3 hours ago, f2k sel said:

Sounds to me like it's just falling to the ground.

Unless there's a way to disable physics without using  enablesimulation which won't work if your going to get in the MG you may have to use the attachto command.

 

You just place an object such as flag pole on the map anywhere, name it pole then after you've moved the gun to the new position  attach it to the pole.

gun attachto [pole];

 

No, that's not a problem. The MG can fly in the air if I want to by ...(getpos mg select 2) + 2] for instance.

Share this post


Link to post
Share on other sites

Sorry but I'm confused using modeltoworld [0,1,0] will  transfer mg  to 1 meter in front of the player and at the same height that's the whole point as it's relative to the player.

 

 

 

Share this post


Link to post
Share on other sites
5 hours ago, Taylor1984 said:

I use the setpos command, yes, and getpos to the unit. Shouldn't there be a way to getpos the unit's height and transfer that to the MG? I've noticed that if I setpos a unit into a house with an elevated floor the unit will automatically land on top of the floor, shouldn't there be a way to do the same for other objects like the MG?

Thanks, I tried using it but I don't really understand how it works.

No, that's not a problem. The MG can fly in the air if I want to by ...(getpos mg select 2) + 2] for instance.

 

_static = createVehicle ['B_HMG_01_high_F',[0,0,0],[],0,'NONE'];
_static setDir (getDir player);
_static setPosASL (player modelToWorldWorld [0,1,0]);

 

manipulate the [X,Y,Z] numbers [0,1,0]   to get an idea of how it works

Share this post


Link to post
Share on other sites

×