Pseudo-Joint and Rotation Problems

BuzzCutsBuzzCuts Member Posts: 3
edited July 2012 in Working with GS (Mac)
Hi All,

I'm a newbie to GS and I've spent the last couple days testing different ways of doing a pseudo-joint. I'm starting to pull my hair out but I'm determined to figure it out.

First I did my own version detecting the acceleration of my actor and basing the rotation and position on the 2nd (tail) actor. It worked fine except there were a lot of messy edge cases with the physics.

I then tried to use this method: https://forums.gamesalad.com/discussion/34757/constraining-actor-to-another-and-staying-there - very clever setup but for me it won't start the tail actor on my main actor; it follows correctly except that it's many pixels away (usually off-screen). It seems if I place it at the bottom right of the scene (0,0 registration?) it's closer, but still from from perfect.

Frustrated with that, I went back to my original method but now it won't detect rotation at all, and - of course - I didn't save an earlier version :(

So, two questions.

1) Does anyone have a template they could share of the above method, or be able to offer insight why the position might be off? My main object is a mouse (ball) that bounces with some random velocity. It doesn't matter where it starts on the screen, it's never with the tail (although the tail follows from a distance). For the tail to be attached, it seems it would have to be way off the scene to the bottom-right.

2) Why might this rule not work:
"When All are valid:
Attribute: self.Rotation >0
Attribute: self.Rotation <80"

I know it's not just the actions because I have a text box showing a boolean (always false); it's not detecting the rotation. I also know that the self.Rotation is working because I have a text box showing that. I've also tried different ranges to no avail.

Thanks in advance for any help!

Best Answer

Answers

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Sorry -- I'm not quite following what you want. Do you want a ball actor that matches the mouse location, and also 'tail' actor that follows the ball at a certain distance and angle in relation to the ball?

  • BuzzCutsBuzzCuts Member Posts: 3
    Ah, sorry; confusing.

    My actor IS a mouse, as in a little furry thing that likes cheese. Nothing to do with the mouse cursor. My bad.

    Yes to the second part, the 'tail' should be attached to the mouse, hence 'following' with no distance. It's a separate actor as it will have its own behaviour and animation.
  • BuzzCutsBuzzCuts Member Posts: 3
    Thanks, I think this might do the trick!

    Since my mouse isn't following anything in particular (just bouncing around) I used vectorToAngle to get it to face the right direction. I'll try and use animation inside the actor to simulate the actual frames or rotation since having it interpolate on collision just seemed too messy.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Glad it will work for you.

    The body can have any movement behavior you can dream up. The 'tail' has all the code to keep itself in the correct relationship to the body.
Sign In or Register to comment.