Maths Pros Orbit Demo Problem #2

giacomopoppigiacomopoppi Member, PRO Posts: 914
edited November -1 in Working with GS (Mac)
Hello all! I am having a second problem with this demo made by tshirt and I need the maths pro's advice.
Basically I need the orbiteer to slow down to a stop and then restart continuing it's orbit. How can I do this?

I have worked out that you decide the speed of the orbit by changing the value after self.Time in the expression.

This is the maths of the demo:
100*cos( self.Time *-200%360)+ game.sunX
100*sin( self.Time *-200%360)+ game.sunY
vectorToAngle( game.sunX – self.Position.X , game.sunY – self.Position.Y )

However when I try to change the speed of the orbiteer IN GAME it goes back to the start of the orbit. If I change the speed of the orbit before I preview the game, it works correctly.

If anyone can help please do! ;) Thanks in advance!

Giacomo

Comments

  • old_kipperold_kipper Member Posts: 1,420
    I am no maths wizard but would it work if the changing value you want to have was inserted as a reference pointing to real number attribute that you did the adjustment with? This would mean that the equation became constantly adjustable in realtime I think.

    kipper
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    @old_kipper Nah, I don't believe that is the problem right now. Thanks anyway ;)

    @everyone A work around is possible if I can calculate the "offset" of the orbiteer anywhere it is in the orbit. Anyone know how to calculate the offset of the actor anywhere it is in the orbit? (CodeMonkey? Tshirt?)
  • StusAppsStusApps Member, PRO Posts: 1,352
    I've just been doing something similar. I think I encountered the same issue. Have you tried changing the speed by interpolate rather than change attribute? Seems to work better for me.
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    Yep, I have just realized that the changing the speed isn't a problem because it actually works. The real problem is that as soon as it starts to slow down, it starts to go back to where it began the orbit.

    I need to find the angle (the offset) where the orbiteer is located in the orbit so that it continues from where it left off. It's very difficult to explain.

    Giacomo

    P.S. If you don't understand I can post a video.
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    Need to bump this thread because I just can't solve it alone :/

    Summary question of the thread:
    Is it possible to calculate the angle at which the actor is in the orbit?

    Giacomo
Sign In or Register to comment.