Throwable Item Guide

vgwizardx

New member
So I struggled to get the throwable item working. Mainly because it didn't work when I tried to set it up like Nolan. Grenade (script) is Trajectory Object (script). I think Grenade (script) should be called Grenade Trajectory Object (script). This would have made things a little clearer.

Sorry, my indents aren't showing.

1. Go to Tools->Opsive->Ultimate Character Controller->Item Type Manager
a. Create a new item collection if you don't already have one made. (It is recommended to create your own and not use demo).
b. Click Category tab
i. add a category (we can start with just one category called Rocks)
c. Click Item Types tab -> Add Item type
i. Name: Rock
ii. Category: Rocks
iii. Capacity (5 can be any number less than default)

1578179939352.png
2. Create a sphere or use any object you need make sure it has the following
1578179966061.png
3. Go to Tools->Opsive->Ultimate Character Controller->Item Manager
a. Name: Rock
b. Item Type: Rock
c. Character: Your Character prefab from Hierarchy (in my case James)
d. Uncheck Add to Default Loadout
e. Animator Item Id if you have one (41 if you want to use grenade animations)
f. Third Person Visible Item (I used sphere)
g. Hand: right
h. Animator Controller: None
i. Action Type: Throwable Item
j. Consumable Item Type: Rock
k. State Configuration: None
l. Profile: None
1578180011064.png
4. Click build item
 
Last edited:
5. Under your character's rig dig down until you get to the right hand->items
a. Resize the scale of the transform to the size you need I changed all values to .2
b. Move it so it is under your characters right-hand
c. Drag rock down to your prefab folder in your project
d. In the Rock Prefab add
i. Rigidbody
1. Make sure Use Gravity is checked
ii. Trajectory Object
1. Use defaults
6. Go to the Rock in your items folder in the hierarchy that is a child of your character (Mine is James)
1578180123391.png
*note-This is not necessary but I also rename rock to RightRock
7. Go to Throwable Item Component of Rock
a. Throw Object: Rock (in prefab folder)
b. Consumable Item: Rock
8. Add Trajectory Object
a. Default values
9. Line Renderer
a. Positions -> Size 0
b. Width: .15
c. Materials->Element 0: FragGrenadeTrajectory (I used the one in demo)
10. Go to Tools->Opsive->Ultimate Character Controller->Object Manager
a. Name: RockPickup
b. Object Type: Item Pickup
c. GameObject: Rock (in prefab folder)
1578180135209.png
11. Click Build Object
12. Save to your prefab folder
13. Go to your new RockPickup

a. Item Pickup Component
i. Item Type Counts
1. Add Rock Type and count 1
14. Place your RockPickup item in your scene
15. Click Play grab RockPickup and try throwing


If you run into any problems with this guide let me know I will update the guide
 
Last edited:
Ha, I've just been on this very journey only figuring out the need for a trajectory component last night. I wish I'd found this post last week!
 
Top