Cant get pistol dual wield to work.

zoicelols

Member
I assigned left click to slot 1 action id 1. Assigned pistol to the same ids. Created animation event for use item on attack state. For some reason when I press play the dual pistols are not visible. Only visible during scene before play.

Also right now Im just trying to get the left pistol to fire and play its animation before I do the right gun.

I created my own new weapon name called New Dual Pistols state. For shooting is the aim state required? Im trying to go straight from any state to firing without aiming at all since i disabled the ability.

When I press left click during play, nothing happens. So lost. I tried copying the demo scene animator and settings on the items but still no go.
 

Justin

Administrator
Staff member
I would compare your settings to the dual pistols while you are in play mode so the correct states are active. This should help indicate what is wrong since there are a number of things that can go wrong.

I assigned left click to slot 1 action id 1.
This won't prevent the pistol from not being visible but you should be using an action id of 0. Your shootable weapon component on the pistol will also have an id of 0:

1546976565748.png

Also right now Im just trying to get the left pistol to fire and play its animation before I do the right gun.
Have you setup a single pistol within slot 0 successfully? If not I would get that working first and then add the second pistol. You should be able to follow similar steps as the assault rifle:

 

zoicelols

Member
Okay I got the right pistol to shoot and animate. When I created a second pistol for duel wield and assigned it to the left hand, then I press play and the "Left Pistol" model under Hand.L/Items leaves this location and places its self under the Hand.R/Items and then the right hand just has two overlapping guns.
 
Last edited:

Justin

Administrator
Staff member
"Left Pistol" model under Hand.L/Items leaves this location and places its self under the Hand.L/Items
Is this correct? It looks like both hands are the same name.

right hand just has two overlapping guns.
Are you using a separate base object similar to the demo? If you are you'll want to create a state within the Item Manager that is called Dual Pistols and then add the Object Activator component to any materials that you want to deactivate when the dual wield pistols are equipped. A good example of this is on the FIrst Person Objects/NolanFirstPersonArms/RightArm GameObject:

1547671181344.png
 

zoicelols

Member
I edited my post. I meant to say that the left pistol model moves to Hand.R , the right hand when I press play.

What do you mean by separate model like the demo? Do you mean two different pistol models? one for left hand and one for right hand? I have a pistol for the right hand and a left pistol for the left hand model. I followed the video when putting the actual pistol pickup model into the slot for item creation.
Also I'm not sure what I would want to deactivate to solve this issue.
 
Last edited:

Justin

Administrator
Staff member
Are you setting up first or third person? I was assuming first but my answers depend on that. Dual pistols take a bit more to setup so I think that I'll add a section to the docs which explain step by step how to add it.
 

zoicelols

Member
I only have the third person asset. That would be amazing if dual pistols were added to docs. :) Ive been trying and failing for a bit on this.
 

Justin

Administrator
Staff member
Oh, third person should be easier :) My previous comments were related to first person so disregard those.

It sounds like the main issue that you are having is that the left hand gun switches to the right. Under the Third Person Perspective Item does your left pistol point to the correct Object?

1547926290176.png

In this case Pistol is the left hand pistol. If it does you can debug why it is changing parents within PerspectiveItem.Initialize. It should not get to the GetSpawnParent method since Object is not null.
 

zoicelols

Member
That solved it perfectly haha thanks! It was a different object referenced than the other one. Now the hands each hold one pistol.
 
Top