Flashlight for Left Hand

ashulgach

New member
I know I make several posts, but because there is extremely limited documentation, I hope my questions are found to be useful for others trying to achieve similar goals.

I'm trying to make the flashlight appear in the left hand only. The demo doesn't really show how to set this up because as a runtime pick up, it should then occupy a runtime object like the runtime pickup video tutorial explains. There is no demo asset matching a RuntimeFlashlight but there is a pick up item for flashlights. When I tried dropping it in my scene, using my own item type from my own item collection, it appears in the right hand and bugs out. I assigned "44" as the animation ID because that's what the demo flashlight asset uses.

Am I supposed to add another script to the RuntimeFlashlight prefab? How do I make it in the left hand? Can I have it in the left hand and swap the right hand? I want to have the flashlight in my hands at all times while swapping the right hand weapons, which is a very normal feeling feature. I just can't figure out how to do it.

Thanks!
 
I think you're getting mixed up between Runtime Pickup items and ItemPickup objects.

The Flashlight item in the demo scene isn't a Runtime Pickup item - it's a regular item, like the AsssaultRifle and others. You can tell this by seeing that the Flashlight item gameobject exists in the scene hierarchy, under the character gameobject's "Items" parent, along with many of the other weapons and items. The Bow, for example, is a runtime pickup item - it doesn't appear in the scene hierarchy at all, and there is a "Bow" prefab gameobject that contains all the components you'd expect on an item (e.g. Item, ShootableWeapon, etc).

So you'd just ago about changing which arm the flashlight is held in as you would any other normal item, e.g. changing the slot ID, moving the visible item to the left hand, etc.
 
Yes, I did just what you suggested. I duplicated one of my other right hand items, and changed it to left hand with the flashlight model but it doesn't work. It spawns in my left hand but bugs out and doesn't let me switch weapons or equip a right handed weapon. How do I set up a flashlight? Where in the documentation is the guide for setting up the flashlight? The FlashlightPickup prefab is looks to me like a runtime object so I'm completely lost. What about all my other questions above?
 
The flashlight doesn't require much configuration so I haven't created any docs for it. We only have animations for the right hand so that could be what problem you're running into.

It spawns in my left hand but bugs out and doesn't let me switch weapons or equip a right handed weapon
That sounds like you are missing the equip complete event. With the right hand the animation event calls equip/equip complete, but since you are spawning in the left hand those events won't be there. You should use a timer instead on the item component.

The FlashlightPickup prefab is looks to me like a runtime object so I'm completely lost.
That is for the pickup, not for actually spawning the item like the bow or katana. The flashlight is preconfigured on the character and you can see it in the demo scene under Nolan/Items. If you haven't seen this GameObject yet you could try comparing your settings to that.
 
Top