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


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to remove a Timer Loop which opens a door using AddPropForce?
Akumasama Offline
Member

Posts: 122
Threads: 2
Joined: Nov 2010
Reputation: 0
#8
RE: How to remove a Timer Loop which opens a door using AddPropForce?

Mmm... that doesnt seem to be the problem.

Oh, I think I see it now.

void TimerDoor(string &in asTimer)
{
    if(asTimer == "swing_door")
    {
        AddPropForce("prison_section_2", 0.0f, 0.0f, 25.0f, "");
    }
    else
    {
        AddPropForce("prison_section_2", 0.0f, 0.0f, -95.0f, "");
    }
    AddTimer(asTimer, 0.03, "TimerDoor");
}
What it does, is that the timer isn't 0.01, so it keeps doing the second AddPropForce.
And thus, making it close/open all the time.
I think that this is the problem, when thinking logically.

EDIT: And so after reading your post again, I see this isn't what your looking for...
Maybe try making timer last longer, make the it push the door open until the time runs out, and have nothing on the other side of the "else".
That would make it stop looping...
(This post was last modified: 12-12-2010, 02:18 AM by Akumasama.)
12-12-2010, 02:13 AM
Find


Messages In This Thread
RE: How to remove a Timer Loop which opens a door using AddPropForce? - by Akumasama - 12-12-2010, 02:13 AM



Users browsing this thread: 3 Guest(s)