How to orbit around one actor while always point to another actor (level end actor)
Hi all,
I am trying to have a pointer actor orbit around my main character actor, and always point at the level end. The level end has it's own X and Y attributes that I have constrained to, as well as the main character, but I cannot figure out how to constrain the arrow to the main character while also constraining the arrow's angle to the level end actor.
I am trying to have a pointer actor orbit around my main character actor, and always point at the level end. The level end has it's own X and Y attributes that I have constrained to, as well as the main character, but I cannot figure out how to constrain the arrow to the main character while also constraining the arrow's angle to the level end actor.
Best Answer
-
poopdecksweeper Posts: 180
i got it! thanks for the help man. Here is the formula I had to use:
constrain: self.position X to -35*cos(vectorToAngle( self.Position.X - game.FireX , self.Position.Y - game.FireY )%360)+ game.HeroX
constrain: self.position Y to -35*sin(vectorToAngle( self.Position.X - game.FireX , self.Position.Y - game.FireY )%360)+ game.HeroY
constrain: self.rotation to vectorToAngle( self.Position.X - game.FireX , self.Position.Y - game.FireY )-270
I realized that the actor is constrained to numerous different attributes which change the actor's rotation. Therefore, I had to deduct the rotation difference from the main character actor.
Thanks for the help
Answers
I even tried using your orbit video as a template, but I don't know how to do the rules without your time rules as a constant.
thanks so far