Game Development Community

how to hide weapon when player is in water?

by deepscratch · in Torque Game Engine Advanced · 03/18/2009 (7:34 am) · 5 replies

as the title says.
I need to hide and disable player weapons when he is in water, its really not normal to swim freestyle fith an m16 or swarmgun or even a pistol in your hand, now is it?
any suggestions as how to disable and hide them while in water would be a great help
thanks all.

#1
03/18/2009 (7:38 am)
Quick answer: %player.unmountImage([IMAGE NAME], 0);

This should do the trick for you.

Obviously you will need to get the reference to the player/ghost and trigger the unmount when you enter the water.
#2
03/18/2009 (10:12 am)
Something along the lines of: unmountImage(getMountedImage(), 0) ... right in there with the onEnterLiquid callback.
#3
03/19/2009 (10:58 am)
ok, so I took
%obj.unmountImage($WeaponSlot);
out of the onMount function, and added it to the onEnterLiquid function, then took
%obj.mountImage(%obj.lastWeapon, $WeaponSlot);
and added it to the onLeaveLiquid function.
works a treat
#4
04/07/2009 (10:09 am)
deepscratch,

A related question for you if you have a minute.

Did you make any progress on water density? I am having a similar issue and saw your post http://www.garagegames.com/community/forums/viewthread/81157

We want to put boats on water and not have them sink....but even just experimenting with Stronghold, setting density for the water and player seems to have no affect.

Thanks in advance for the reply!
#5
04/07/2009 (10:28 am)
I believe there will be, I've been chating with a dev(indie) whose busy with exactly that! and its coming on nicely, boxes floating(tested, yes) and affected by waves. hes doing a good job of it.
BTW, post about physx upcomings in the 1.8.1 physx dev thread
Here