Game Development Community

Is there an "easy" way to make specific parts of a player "interactive"?

by Kyrah Abattoir · in Torque 3D Beginner · 09/27/2012 (3:25 pm) · 4 replies

So i was thinking, most games use hitboxes to detect headshots, would it be possible to use this to make interactive parts on a player?

I assume it would involve tracing a vector to detect what was interacted with?

Examples:
-Steal a player's holstered gun by pointing at it and "using" it (whatever that might be).
-Use a teammeate's backpack mounted radio.
-"Visual" paperdoll where you can drag and drop pieces of equipment to and from a 3D representation of the player.

#1
09/27/2012 (4:00 pm)
Been thinking about this for a little while (keep in mind I have not tried it yet) Why not use multiple collision meshes? Have the head collision-1 and the legs collision-2 etc? That way you can ID each 'part' and go from there? I may be way off on that, but it's a starting point.
#2
09/27/2012 (10:51 pm)
There's actually several ways you can approach this.
Ron's example above would work perfectly fine, and is artist controlled, but other ways you could go about it is mounting triggers(there was a resource to do this) and raycasting against them, or mounting item or a custom equipment class to a mountpoint, and raycasting against it, and executing custom code that way.
#3
09/28/2012 (1:32 pm)
okay so a mounted object can be raycasted against without needing a custom hitbox in the player model?
#4
09/28/2012 (2:16 pm)
I was thinking along the lines of invisible boxes (mounted to player or just existing in the world) that have their own type. Keyboard "U" button starts a function that casts a ray setup to only collide with these invisi-switches. The ray would have to have limited distance or it would return false positives.

If the ray comes back that it hit an invisi-switch, the switch datablock would have information on what to execute if hit.

Is that similar to the mounted triggers?