🪓
Survival Starter Kit
  • 👋Survival Starter Kit
  • Overview
    • 📝Release Notes
  • Technical Details
    • ⚙️ItemData
  • Fundamentals
    • ⚒️Create an Item
    • ⚔️Create a Weapon
    • 🪨Create a Resource
    • 🍖Create a Consumable
Powered by GitBook
On this page
  • Step 1
  • Step 2
  • Step 3
  • Step 3.1
  • Step 3.2
  • Step 3.3
  • Step 3.4
  • Step 3.5
  • Step 4
  • Step 4.1
  • Step 4.2
  • Step 4.3
  • Step 4.4
  • Step 4.5
  • Step 4.6
  • Step 4.7
  • Step 4.8
  • Step 5
  • Step 6
  • Step 6.1
  • Step 6.2
  • Step 6.3
  • Step 6.4
  • Step 6.5
  • Step 6.6
  • Step 6.7
  • Step 6.8
  • Step 7
  1. Fundamentals

Create a Weapon

This page will show you how to create a new weapon. The weapon can gather resources, damage NPCs, or both based on the properties you provide the system.

PreviousCreate an ItemNextCreate a Resource

Last updated 2 years ago

Step 1

First, you'll want to .

Step 2

Second, you'll want to ensure that the Usage, Resource Gathering, and Combat sections are filled out correctly and make sense for your new weapon.

Usage Rate determines how fast this weapon can be used

Usage Distance determines the distance at which objects are affected by this weapon

Can Gather Resources is for tools that will be used to harvest materials from raw materials like wood from trees or stone from rocks

Types that can be gathered are simply the types of resources this weapon can harvest from raw materials

Can Deal Damage determines if this weapon is able to hurt NPCs or not

Damage is the amount of damage given when an NPC is hit with this weapon

Step 3

Create a wieldable prefab using the following steps

Step 3.1

The easiest way to get started is to duplicate an existing wieldable prefab. You can find one in the Stonehill Games\Survival Starter Kit\Prefabs\Wieldables folder. Once you have located one you can press Ctrl+D on windows or Cmd+D on a mac to duplicate the object. Name it something like YourObject_Wieldable for example Knife_Wieldable.

Step 3.2

Double-click the new wieldable prefab to open it.

Step 3.3

Place your model in the opened prefab and align it with the existing model.

Step 3.4

Delete the existing model

Step 3.5

Select the top-level prefab object and change the Wield Tool Item to the Item Data object you created in the previous steps

Step 4

Change the animation controller and animations using the following steps

Step 4.1

For this demo, I will copy the sword animations and use them for the knife I'm creating. Start by finding the sword animations in Stonehill Games\Survival Start Kit\Animations\Sword.

Step 4.2

Duplicate the Sword folder and name it Knife

Step 4.3

Rename the files to have the title Knife instead of Sword

Step 4.4

Select the Knife Animation Controller and drag it into the Controller slot of the Animator script

Step 4.5

Open the animator controller by double-clicking it.

Step 4.6

Select the Sword Idle animation by clicking on it

Step 4.7

Rename it to Knife Idle and select the Knife Idle animation in the Motion

Step 4.8

Do the same thing with the attack animation. Select it by clicking on it, rename it to Knife Attack, and select the Knife Attack Motion

Step 5

Select the ItemData object you created earlier and set the Wieldable Prefab equal to the Knife_Wieldable object you just created

Step 6

Create the drop prefab using the following steps

Step 6.1

Duplicate the Sword_Drop prefab and name it Knife_Drop

Step 6.2

Open the Knife_Drop prefab

Step 6.3

Drag your model into the hierarchy and position it on top of the sword model that is already there

Step 6.4

Delete the sword model

Step 6.5

Select the top-level prefab object and set the Item Object Item to the ItemData object you created earlier

Step 6.6

Edit the collider to fit the model you dragged into the prefab

Step 6.7

Exit the prefab editor and select the ItemData object you created earlier

Step 6.8

Set the Drop Prefab equal to the Knife_Drop prefab you just created

Step 7

Drop your prefab item into the world, pick it up, and equip it. You should see the wieldable prefab selected when you use your mouse wheel to select the weapon from your inventory. Next, you should be able to inflict damage on the world if you set the Can Deal Damage flag to true and set the Damage value to greater than zero.

You can get details about each section in the section of this manual.

ItemData
⚔️
Create an Item
Page cover image