Problem with Runtime Pickup

Jued

New member
Hi. I dont know what`s the problem. I repeat all like in yours video, but when I add item on scene and hit "Play" - I receive errors like
Object reference not set to an instance of an object


5.png

And all of this errors triger in line

m_Character = m_CharacterLocomotion.gameObject;

Is it problem with character?
 
Okey, I created a new project, imported UFPS, and create Camera, Game, update layers and button1.png

Next I created character
8.png

Created item. Checked it, all works good
3.png


Then I created Bow
4.png
5.png
6.png


And again this error.What is wrong?)
7.png
 

Attachments

  • 5.png
    5.png
    40.8 KB · Views: 0
When I can pick up this bow, I can change weapon on it only once.
I mean I start whith rifle in hands, pick up bow, roll mouse wheel to bow, one more time to rifle and one more time - happen nothing.
And the bow appear on scene again. But I cant pick up it again.
 
Last edited:
It looks like you are missing the base object. In the video the base object was already created from previous items. You have two options:

1. Add a base object to the runtime pickup.
2. Create the base object ahead of time by following the normal item setup video and then removing just the actual item. This will keep the base object (the arms) so when the bow pickup is added it'll be able to find the base object.
 
Here's a scene that you can compare against. In this it has the assault rifle and the runtime pickup bow. Nothing is positioned correctly but at least you won't get any errors when you pick up the bow. The one trick was that I had to manually create an item slot with the id of 1 because the editor didn't create that for me automatically when I added the assault rifle initially.

https://gofile.io/?c=rKNxZA

1548188472565.png
 
Anyway I have that error.
And I fix it only when reinstal Unity :\
Now all works fine)

Sorry to troble you)
 
Top