Rotate pinball paddle not working?

jermerquajermerqua Member Posts: 17
edited November -1 in Working with GS (Mac)
So i am trying to create a simple Pinball game. I have a Paddle at the bottom to hit the ball so it can not pass. I simply want the user to click the space bar (down) to rotate it so that it can hit the ball and lift up on space bar to return the paddle to it's original state. I set 2 rules

Rule1
On key (spacebar is down)
Rotate angle (45%, speed = 900, relative to actor, stop on destination)
Rule 2
On key (spacebar is up)
Rotate angle (45%, speed = 0, relative to actor, stop on destination)

The first rule works but when I release the spacebar the paddle does not return to it's original position. Any ideas why? Work arounds? Seems so simple.

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    try rotate to angle and check both check boxes
  • jermerquajermerqua Member Posts: 17
    I'm already using "rotate to angle"

    just checked both "run to completion" & "stop at destination" and still not working. I have the most stripped down bare bones file too. This is this is the only thing i am trying to do in this file I am using. Argg!
  • jermerquajermerqua Member Posts: 17
    Okay so a couple things I figured out.

    I turned off Moveable in the paddle asset, because I didn't want it affected by gravity, which completely disabled it from rotating.

    I tried placing the "rotate to angle" in the "otherwise" portion of teh rule and still no go.

    SO the paddle HAS TO BE affected by gravity and is a pain to get to rotate to-and-fro.
  • jermerquajermerqua Member Posts: 17
    constrain attribute (position X & Y) solve the gravity issue :-) Still have the rotate to-and-from. Can rotate paddle 45 degree up but not back to 0
  • jermerquajermerqua Member Posts: 17
    OKAY I've got it!

    Change the angle of rotation to be "relative to: scene" vs "relative to: actor"... makes complete sense. Once you rotate the actor to 45 degrees (if relative to:actor) it then resets it's angle to 0 degrees after rotation so while it is infact working when I release the spacebar and it set's the angle to 0 degrees it just so happens that it's already at 0 degrees.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Have you checked this with the ball collision yet? Not to be a pessimist, but I have found that when you try to make something not respond to gravity it can cause issues. GS really needs a way to uncheck an "affected by gravity" attribute or something. Here's what I have found to work well for a situation like what I am imagining you are working with. The only actor you likely want to fall is the ball, right? So the easiest thing to do is set gravity to 0 and place an accelerate behavior in the ball in the direction it is falling - this has the same effect as gravity but it is only applied to the ball. The other cool thing about this is you can now have the acceleration applied to the left or right and you can make your pinball game in portrait orientation instead of landscape which would make sense for pinball. The hassle is that you have to rotate all your actors. In the end it would probably be a better pinball game and worth the effort.
  • jermerquajermerqua Member Posts: 17
    You are SO right. Thanks for the preemptive suggestion. here is the situation I just ran into...

    1) place paddle on stage, add ball, add gravity
    2) add collide to ball and set to collide with paddle
    3) uncheck moveable and ball bounces off paddle perfectly
    4) check moveable but at a "constrain attribute" and set a constent X and Y THEN the ball simply slows down when it hits the paddle and proceeds to pass right through

    for some apparent reason the "constrain attribute" has an affect on the objects ability to collide.

    Crazy :-) I will try working with acceleration over gravity but your siggestion is right on and infact where I went to instinctively which is too look immediately for the "not affected by gravity" chekc mark.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    yeah, I think you will find that making one actor accelerate is way easier than trying to make all of the rest of your actors be unaffected by gravity yet still have the ability to rotate or do other movements. I would keep gravity at 0.
Sign In or Register to comment.