Announcement

Collapse
No announcement yet.

[Help] How do i set scaling damage from a spear based on player velocity

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

    [Help] How do i set scaling damage from a spear based on player velocity

    I am very new to unreal, and would like to set up a blueprint that deals a certain amount of damage to a player based upon how fast the (self) player is moving. I have a sphere collision component and can set it up so that on collision it destroys actors, but i would like to do scaling damage. Any help would be much appreciated!!

    #2
    First you need to setup the whole concept of "health" and "damage". Actors which can take damage need a variable added to them to keep track of their health. When the health is 0, you can have them die / destroy.
    When the spear collides with the actor, instead of destroying it you can "deal damage", which essentially means "subtract from health".
    To make it scale based on velocity, you can use the "Get Velocity" node on the player, and then get the "Length" of that vector. This is the speed of the player. Then, do whatever math you want to make the speed influence the damage.

    Comment


      #3
      You're also going to need to be able to cast between your spear and player blueprint, but that's a really good thing to learn, as you will often need different BluePrints to communicate with each other.

      Comment

      Working...
      X