GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Rotating 180 degrees from bottom of actor constantly

Hi There,

i have an actor 100 high, 10 wide, and need it to go from facing 180 to facing 0 constantly, rotating from the bottom.

Can anyone guide me in the right direction?

Thanks

Comments

  • SocksSocks London, UK.Posts: 12,822Member
    edited May 2015

    Constrain X to: 50 *cos((90 *sin( game.Time *100))+90)+X position

    Constrain Y to: 50 *sin((90 *sin( game.Time *100))+90)+Y position

    Constrain Rotation to: 90 *sin(game.Time *100)

  • SocksSocks London, UK.Posts: 12,822Member
  • MoosefaceMooseface Posts: 13Member

    thanks socks tht great, it nearly works how i want it.

    i need the bottom of the stick to stay in the same place? can you help

  • SocksSocks London, UK.Posts: 12,822Member
    edited May 2015

    @Mooseface said:
    thanks socks tht great, it nearly works how i want it.

    i need the bottom of the stick to stay in the same place? can you help

    Yes, use the code I posted above, it rotates the actor from its base.

  • MoosefaceMooseface Posts: 13Member

    i have but it moves round the bottom of the screen, the bottom doesnt stay fixed

  • SocksSocks London, UK.Posts: 12,822Member

    @Mooseface said:
    i have but it moves round the bottom of the screen, the bottom doesnt stay fixed

    Could you take a screenshot of your rules.

  • MoosefaceMooseface Posts: 13Member

    socks, you are the man /or woman, thanks very much i had missed a ) out

  • MoosefaceMooseface Posts: 13Member

    Socks, you might be able to help with this I have 2 more problems.

    I have a setup where for every .1 seconds you hold the up button the height increases of the actor by 5 and the y position also increases by 2.5 to compensate so it gives the illusion it is growing longer. This worked before the rotation but not it grows at top and bottom?

    Also I have a actor constrained to the top of the stick, this doesn't stay constrained when it rotates or grows at an angle but does if it grows straight up. Is there a way to fix it even with the rotate?

  • SocksSocks London, UK.Posts: 12,822Member
    edited May 2015

    @Mooseface said:
    Socks, you might be able to help with this I have 2 more problems.

    I have a setup where for every .1 seconds you hold the up button the height increases of the actor by 5 and the y position also increases by 2.5 to compensate so it gives the illusion it is growing longer. This worked before the rotation but not it grows at top and bottom?

    I don't know what this means, your language is a bit vague. "but not it grows at top" ?

    @Mooseface said:
    Also I have a actor constrained to the top of the stick, this doesn't stay constrained when it rotates or grows at an angle but does if it grows straight up. Is there a way to fix it even with the rotate?

    "rotates or grows at an angle" ? Not sure what that means either ? Asking someone to amend some existing code without showing them the code is an exercise in mind reading ! :smiley: I will answer your question if you answer mine: I have a calculation, it was working fine, but I added it to another calculation and now it doesn't work, is there a way to fix this ?

  • MoosefaceMooseface Posts: 13Member

    Let me have another go.

    So I am talking about the same actor that has been given the rotate function. 100 high by 10 wide.

    I have a rule setup so that every .1 seconds you hold the up button down, it increases the height of the actor by 5. This puts 2.5 to the top and -2,5 to the bottom.

    I have set it to also increase the y axis of the actor by 2.5 at the same time. So it only gets longer from the top.

    The problem now is, unless the actor is at 90 degrees, it doesn't gove the same effect of only growing from the top. And I can't figure out why.

  • SocksSocks London, UK.Posts: 12,822Member

    @Mooseface said:
    Let me have another go.

    So I am talking about the same actor that has been given the rotate function. 100 high by 10 wide.

    I have a rule setup so that every .1 seconds you hold the up button down, it increases the height of the actor by 5. This puts 2.5 to the top and -2,5 to the bottom.

    I have set it to also increase the y axis of the actor by 2.5 at the same time. So it only gets longer from the top.

    The problem now is, unless the actor is at 90 degrees, it doesn't gove the same effect of only growing from the top. And I can't figure out why.

    Like I say, asking someone to amend existing code without showing them the code is an exercise in mind reading, I have no clue how you are doing any of this, so any attempts at fixing it would be a guess.

Sign In or Register to comment.