Calculate subtracted value in a text object


#1

hi, my character has a chainsaw and when it hits the enemy the hp variable is subtracted based on the collision time.
to do this I have entered this code

action:
chainsaw is in collision with enemy

action:
change the enemy’s hp variable - timedelta () +0.1

can you tell me how to calculate in a text object the variable hp subtracted by an enemy when it is hit?


#2

Just wrap your calculation in a ToString().


#3

You can do this in two ways if you calculate and substract from the enemy variable or if you use a custom scene variable to get the calculated damage


#4

thanks for your help