Quick Setup

circle-info

QUICK START: Use the included demo prefab to add all the required components to your scene with one drag and drop asset. Then customise to your liking!

1). Add the β€œSurvival Interactor” script to your main camera.

circle-info

Survival Interactor is the Raycast script for interacting with 3D objects.

  • Ray Length: The distance you can interact with objects (Default: 5)

  • Interact Key: This is the input key to interact with items in the scenes (Default: Mouse 0)

2). Add β€œSurvival Vitals Manager” to your hierarchy from the prefabs folder and you can use the settings as below or customise them to your liking:

  • Player / Max Health: The amount of health the player will currently have and the maximum.

  • Player / Max Stamina: The amount of stamina the player will currently have and the maximum.

  • Stamina Drain: How quickly stamina will fall (Higher is faster)

  • Stamina Regen: How quality stamina will recover over time (Higher is faster)

  • Jump Cost: How much stamina it will cost to perform a jump action

  • Player / Max Hunger: The amount of hunger the player will currently have and the maximum

  • Hunger Drain: How faster hunger will decrease (Higher is faster

  • Player / Max Thirst: The amount of thirst the player will currently have and the maximum.

  • Thirst Drain: How faster hunger will decrease (Higher is faster)

  • Single Damage: This is the damage that will happen when one of Thirst or Hunger is depleted. (Divided by 100 in script - Keep whole numbers)

  • Double Damage: This is the damage that will happen when BOTH thirst and hunger is depleted. (Divided by 100 in script - Keep whole numbers)

  • Death Event: Add events for when you have run out of health

3). Add the canvases from the prefab folder, including:

  • CrosshairCanvas

  • SurvivalUICanvas

4). Add β€œSurvival UI Manager” to your hierarchy from the prefabs folder and you can use the settings as below or customise them to your liking.

  • Add the UI items as seen below to the missing slots from the crosshair and survival canvases

5). Add β€œSurvival Audio Manager” to your hierarchy from the prefabs folder and you can use the settings as below or customise them to your liking.

circle-info

You can add ScriptableObjects to these audio slots in the array to play more sounds that just the ones provided.d

Creating an interactive item:

1). Add a 3D model from the models folder or prefabs. Make sure the are setup as below:

  • Box Collider

  • β€œSurvivalItem” script

    • Choose an item type for your interactive object

    • Item Value for the amount damage, healing or restoration of the vitals

    • Item Sound is the ScriptableObject

circle-info

Add β€œSurvivalItem” to any 3D object for it to become interactive

Last updated