Frictional Games Forum (read-only)

Full Version: Get hitted when à object hit you whith certain speed
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm wondering if it possibe to gain damage by a object that's hitting you whith a x amount of speed. If so, would be possible to measure one part of the model?

Let me explain, like you got a ball whith a rope. The rope and THE ball are attached to each other. Also, THE ball and THE rope are attached to à ceiling.
Would it be possible to measure the speed of that ball, when it release THE ceiling?

I hope you understanded my question :p
Thanks,
Nkmol Big Grin
Very interesting! I feel spoiler'd but that's ok Smile I like your idea, sir.

Unfortunately there is no function (that I'm aware of) to check for the speed of a prop. You can, however, use some clever scripting.

As soon as you release the ball from the ceiling and it starts flying to the player, start a timer. Tweak it so that the timer ends as soon as the ball slows down to the speed at which you do NOT want it to cause player damage.

Then, use this function called by the collision between the ball and the player.

Code:
void BallCollidePlayer(string &in parent, string &in child, int state)
{
    //ball is parent, player is child

    if(GetTimerTimeLeft("ballspeedtimer") > 0) { //Player Gets Damaged! }
    else //Do whatever happens if the player touches it while it is slow (such as LESS player damage)
}
yes interesting Smile
thanks for the advice, i'll experimate a lil Angel
No problem! Glad to have helped Smile