playMaker

Author Topic: Raycast2D  (Read 895 times)

Jeaneymar

  • Playmaker Newbie
  • *
  • Posts: 2
Raycast2D
« on: June 29, 2023, 03:29:01 PM »
Hi, I'm trying to make my enemy shoot at player using a raycast2D's hit point and a line. Cheking the debug, the line touches my player, and the player is detected as a hit object, everything is fine except that the hit point doesn't correspond my player position... at all ! I  tried in world space, and it doesn't work neither.
Any idea ? Thanks

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Raycast2D
« Reply #1 on: June 30, 2023, 11:30:05 AM »
Hi.
Its hard to tell without some images/video on your setup.

try on a new scene, make 2 object (1 to start raycast and 1 to detect)
hit point should be on the edge of the collider.

on hit spawn something visual on the hitpoint position and hit object.
and play around with the settings (filters etc)