0 Favourites

problems with getting object angle

This forum is currently in read-only mode.
  • hi guys.

    once again,ive run into a problem i cant seem to solve by myself.

    trying to keep it short:

    my character gets pushed down the stairs and the player needs to hold down a button to get back up. im using a separate ragdoll character,when the player gets pushed down. im trying to make it so that when the ragdoll character gets all the way back up,its destroyed and the original,playable character takes its place at a correct position. ive run into a problem,where im supposed to trigger an event when the ragdoll character's feet angle equals 0,but it doesnt work. somehow it doesnt detect the angle at all and nothing happens. is there any reason for it?

    could someone help or give some hints?

    here's the .cap to make myself more clear:

    http://dl.dropbox.com/u/11157144/ragdoll.cap

    in short,when the ragdoll is standing up by pressing space,it should be destroyed and the original,movable character should should be spawned to take it's place.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • It looks like the feet never perfectly reach that value, maybe try checking for the angle being between -10 and +10 degrees. I'll try that out and edit this post if I get it to work.

    Edit: Yup, that worked all too well. I tried limiting the range to between +1 and -1 and it is much better now. Here's the cap: http://dl.dropbox.com/u/4714446/ragdoll%20stairs.cap

  • brilliant! thats exactly what i had in mind this morning, it works just as i want now.

    thanks, much appreciated.

    im a little embarrased i couldnt figure out something so simple earlier :/

    i wonder why it doesnt detect the exact angle though, not that it matters now.

  • I think it's because the angle is never exactly 0 degrees when the tick that checks it begins. I've often rotated things in the editor and gotten some obscure value like "90.0019" or something. If you want it to detect something more accurately, you can try rounding the object angle to 0 like this:

    Round(Sprite.Angle)[/code:2j49zvoe]
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)