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
Force to trigger function.
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#5
RE: Force to trigger function.

You place two areas a certain distance from one another.
Place the first area a few inches away from the wall, and put the second on the wall.

Measure the distance between these areas, and declare it in your script as a constant, ie:
float Distance = 0.25f;

Now when the hammer passes through the first area, start a timer, and when it passes through the second timer, call "GetTimerTimeLeft" and use this value to work out the time taken for the collision.

Now divide the Distance by this number to calculate the speed, and have an if statement to check if the speed is larger than a certain value! Smile


Edit: already answered Tongue

(This post was last modified: 04-15-2012, 05:30 PM by DRedshot.)
04-15-2012, 05:29 PM
Find


Messages In This Thread
Force to trigger function. - by AnthonyTrix - 04-15-2012, 05:11 PM
RE: Force to trigger function. - by Acies - 04-15-2012, 05:19 PM
RE: Force to trigger function. - by Homicide13 - 04-15-2012, 05:21 PM
RE: Force to trigger function. - by AnthonyTrix - 04-15-2012, 05:23 PM
RE: Force to trigger function. - by DRedshot - 04-15-2012, 05:29 PM
RE: Force to trigger function. - by Damascus - 04-16-2012, 12:41 AM
RE: Force to trigger function. - by AnthonyTrix - 04-15-2012, 05:33 PM



Users browsing this thread: 1 Guest(s)