Rotation Help

joshmiller602joshmiller602 Member Posts: 206
edited November -1 in Working with GS (Mac)
I know everyone is caught up in the new changes to GS, but I am going to keep working on my game and not think about it until we get final word.

WITH THAT SAID...

Would love some aiming, rotation, & firing help if any pros out there still feel like helping :) :)

My main actor is pulled (slingshot style -- without the slingshot) and released.

I would like his head to rotate in the direction he will be flying (which I am guessing should be the opposite I am pulling), and to fly in that direction. I have looked at MANY templates, but for some reason can't get him to rotate correctly or to fly in the direction his head is pointing at like I want. Any help would be GREATLY appreciated :)

Comments

  • ToastKittenToastKitten Member Posts: 360
    uhhh..... I'm gonna define the point at which there s no tension in the slingshot ( as in no acting on the actor... lol ) is defined as origin.X and origin.Y

    shouldn't something like rotation = vectorToAngle ( origin.X - self.Position.X, origin.Y - self.Position.Y) work?
  • joshmiller602joshmiller602 Member Posts: 206
    I have no idea why that is not working either...have looked at a billion templates. Starting to go crazy LOL
  • ToastKittenToastKitten Member Posts: 360
    are you constraining the rotation attribute?
  • joshmiller602joshmiller602 Member Posts: 206
    Yes.

    Constrain Attribute: self.Rotation To: vectorToAngle( game.Origin.X - self.Position.X , game.Origin.Y - self.Position.Y )
  • ToastKittenToastKitten Member Posts: 360
    hmmm.... is the fixed rotation box unchecked under physics?
  • joshmiller602joshmiller602 Member Posts: 206
    It's unchecked. I can get it to rotate, just not in the direction I need it to.
  • ToastKittenToastKitten Member Posts: 360
    hmmm.... is it at least rotating when you use the constrain attribute method?
  • ORBZORBZ Member Posts: 1,304
    In flight:

    Constrain rotation=vectorToangle (linearVelocityX,linearVelocityY)

    In slingshot:

    do as toastkitten said, except no dot. No origin dot x or origin dot y. And make sure you set those variables with change attribute before you constrain against them or they will be 0.
  • joshmiller602joshmiller602 Member Posts: 206
    ORBZ said:
    And make sure you set those variables with change attribute before you constrain against them or they will be 0.

    So removed the origin.x and origin.y. But kind of confused by this^. Thanks Orbz :)
  • ToastKittenToastKitten Member Posts: 360
    yeah that's my bad josh! Sorry if wasn't really clear or used confusing variable names Dx
  • joshmiller602joshmiller602 Member Posts: 206
    @ToastKitten No problem. I still don't know how to make my guy fire/aim correctly. I've tried the cannon template, the arrow one, and others...to no avail. I can kind of get him to aim, but not accurately enough to have a point system based on the user's aim (unless I want to piss off everyone LOL).

    Maybe I can show what I have already? It may be that another setting is messing up this one...how do I post that on here?
  • ToastKittenToastKitten Member Posts: 360
    you could send me your project to me at Tmitch0 *at* gmail.com

    You could also publish it to the website and make sure that it's downloadable, but then everyone would be able to download it.
  • forkliftforklift Member Posts: 386
    Is the scene size smaller than your camera? If so, camera tracking needs to be added into your equations.
  • joshmiller602joshmiller602 Member Posts: 206
    Sending now Toast :) Thank you!
Sign In or Register to comment.