Game Development Community

player pick up a heavy object

by Rob McNaughton · in Torque 3D Professional · 04/18/2014 (10:48 pm) · 2 replies

I would like to keep 3 weapons in the players inventory and then allow the player to pick up a large object like a crate. When holding the crate the player can't use or switch weapons until he drops the crate. Anybody seen a tutorial or samples to get something like that working? I have a basic FPS MIT 3.5 game I'm working on. I'm up for trying to figure it out myself but I am going pretty slow at finding a solution so far. I would love to know if others have this working.

#1
04/19/2014 (8:12 am)
Essentially, you'll want to either make the crate behave like a weapon, or have it mounted to the player, and the player use a hold animation.

From there you can set a flag along the lines of:

%player.cannotChangeGuns = 1;

And then modify the switch weapons function to check for said flag. Obviously delete the flag when the player drops the crate.
#2
04/19/2014 (9:09 am)
That sounds very logical and I will give that a try. Thanks!