Pointing

sparkaniasparkania Member, PRO Posts: 300
To get one actor to 'look' in the direction of another, I want to constrain the looking actor's rotation to the X/Y of the target actor. I know I need to use vectortoangle, but i cannot seem to nail the formula. The target's X/Y are constrained out to game.TargetX and game.TargetY.

Thanks

Comments

  • CaptFinnCaptFinn Member Posts: 1,828
    are these actors like the eyeballs of another actor. or like a ship keeping its gun on the other actor?
  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2013
    . . . I know I need to use vectortoangle, but i cannot seem to nail the formula . . .
    I'd just use 'Rotate to Position'.

    ▶ = scene.Background.TheThingYouWantTo'Look'At.Position.X
    ▲ = scene.Background.TheThingYouWantTo'Look'At.Position.Y


    http://www.mediafire.com/?8nb7arn9hf1p08l

    (Drag the white box around)
  • sparkaniasparkania Member, PRO Posts: 300
    more the gun.. it's actually a compass per say attached to the center of the screen and rotating to point at a target (off screen)
Sign In or Register to comment.