0
Answered

Equipping range weapons via script

Alieu Cole 3 months ago in Shooter updated by Marti (Lead Developer) 3 months ago 2

Hello! I'm making a game where the Agents have the ability to pick up different weapons as the game plays and needed help equipping range weapons via script. Currently i'm Attaching a script to the a weapon game object which has the correspond game creator melee or shooter weapons attached. During runtime the agent gets the charaterMelee and charatershooter components and when it needs to draw the specific weapon it has, for melee it sets the previous weapon as the current weapon and then "DrawMelee" is set to true which triggers the draw weapon action which draws previous weapon(works great). For range weapons i'm setting the current weapon but haven't figured out a way to draw the specific range weapon in the same way. Any help would be appreciated! :)

Unity version:
2020.1
Game Creator version:
1.1.8
GOOD, I'M SATISFIED
Satisfaction mark by Alieu Cole 3 months ago
+1
Answered

Check out the ActionDrawWeapon action from both the Melee and Shooter module. You'll see in the Execute method how to execute the snippet of code to draw a specific weapon.