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.Member Posts: 12,822
    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.Member Posts: 12,822

  • MoosefaceMooseface Member Posts: 13

    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.Member Posts: 12,822
    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 Member Posts: 13

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

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

    @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 Member Posts: 13

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

  • MoosefaceMooseface Member Posts: 13

    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.Member Posts: 12,822
    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 Member Posts: 13

    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.Member Posts: 12,822

    @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.