- Home /
Character controller Damage by fall
Hi everybody, i have a question that does not let me sleep
I need to pick up the impact of my Character controller when I fall or recreate a predictive line where I pick up the jump path. As I understand the Charactercontroller is not ideal for impacts, but could be emulated by some algorithm? To make a predictive line I know that it is ideal to use linecast but I do not know how to pass the necessary parameters to recreate this predictive line. I need to maintain the charactercontroller
Google translate is my friend
I wish I knew more about linecast to help you but maybe you can try this.
Why not measure the time they are in the air? Every time the character controller is not touching the ground, add to an invisible value. Once they land, use that value to calculate how much damage they should take.
Answer by MSavioti · Oct 11, 2018 at 07:20 AM
I don't think that LineCast it's the ideal thing, what you're probably going to use is RayCast. Make a isGrounded boolean variable if you don't have one (use LineCast for it) and as soon your isGrounded goes to false, save that position and as soon as your player touches the ground, save that position as well, then you compare them both.
Your answer
Follow this Question
Related Questions
Does a mesh collider animate? 0 Answers
How can I make an enemy hurt the player? 3 Answers
Character controller mess up damage 3 Answers
Staged bullet damage? 1 Answer
Punching - what would be the better way? (in javascript) 2 Answers