playMaker

Author Topic: Get Vector2 position in front of Top-Down 2D character  (Read 1688 times)

Ride

  • Playmaker Newbie
  • *
  • Posts: 7
Get Vector2 position in front of Top-Down 2D character
« on: December 27, 2014, 06:30:10 PM »
Hey guys,

I can't wrap my brain around what im trying to achieve, namely to get the XY (Vector 2) location in front of this top-down character.

The character rotates on the Z-axis and the Vector2 position has to correlate with the character in question wherever it rotates/moves.



I've tried raycasting2d from the front of the character, but I havent found a way to get the point coordinates of where the ray ends.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Get Vector2 position in front of Top-Down 2D character
« Reply #1 on: December 27, 2014, 06:54:31 PM »
maybe use a empty object as a child, place that in front of your character and get the vector from the child.

you can also use a collider on the child when needed