Skip to content

Instantly share code, notes, and snippets.

@mrowrpurr
Last active December 6, 2021 01:05
Show Gist options
  • Select an option

  • Save mrowrpurr/166b8c2dc30152d0ccb0c180f8b56a3a to your computer and use it in GitHub Desktop.

Select an option

Save mrowrpurr/166b8c2dc30152d0ccb0c180f8b56a3a to your computer and use it in GitHub Desktop.
Actor player = Game.GetPlayer()
float direction
if player.GetAngleZ() > 180
direction = player.GetAngleZ() - 180
else
direction = player.GetAngleZ() + 180
endIf
float xOffset = (distanceFromTarget) * -Math.cos(player.GetAngleZ());
float yOffset = (distanceFromTarget) * -Math.sin(player.GetAngleZ())
dummyActor.MoveTo(target, afXOffset = yOffset, afYOffset = xOffset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment