[Solved ]Damage based on actor acceleration

obsoleteentertainmentobsoleteentertainment Member, PRO Posts: 21
edited November -1 in Working with GS (Mac)
Hi there,

i have some kind of car race game and want to subtract damage points based on the speed of the car actor when it collides with a wall. How can i solve this?

SOLVED

I put this in the a change attribute behavior

health-(magnitude( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y )

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Make two actor attributes "damagePoints" and "speed". Create a behavior that sets the car's velocity to "speed". When the car collides with the wall, change the damagePoints attribute to: damagePoints+(speed/100). (Replace the 100 with whatever feels right for your game.)
  • obsoleteentertainmentobsoleteentertainment Member, PRO Posts: 21
    Thanks
Sign In or Register to comment.