Announcement

Collapse
No announcement yet.

Trees that you can chop down

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Trees that you can chop down

    Hello i am making an open world game but iv bumped into a problem i have no idea how to create a tree that you can cut and it gives you logs.

    After the tree has been cut it gets destroyed and a few minutes later a new one appears how would i go around creating this?

    #2
    Create a class Tree. Give it a mesh, and few variables:
    - maxChops
    - logsToGive

    Make a function OnHit() override and track how many times the tree has been chopped. if it has been chopped as much as maxChops call a new function DropLogsAndDestroy() where you will spawn few logs or directly give them to the player inventory.

    As for the respawning, you can run a timer on Destroy() for 90 seconds (or as much as you want) and show it again refreshed and ready to be chopped again.
    Raise the Black Flag!

    - [TUT]: HTTP GET Request in C++
    - [Tool]: Game Site Tracker website for your project
    - [Website]: Website for my game Leviathan

    Comment


      #3
      Thanks man!

      Comment

      Working...
      X