Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get hitted when à object hit you whith certain speed
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: Get hitted when à object hit you whith certain speed

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.

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)
}

(This post was last modified: 07-20-2011, 02:35 PM by palistov.)
07-20-2011, 02:34 PM
Find


Messages In This Thread
RE: Get hitted when à object hit you whith certain speed - by palistov - 07-20-2011, 02:34 PM



Users browsing this thread: 1 Guest(s)