playMaker

Author Topic: Translating ScreenPointToRay to Playmaker  (Read 33674 times)

cdutoit

  • Playmaker Newbie
  • *
  • Posts: 30
Translating ScreenPointToRay to Playmaker
« on: August 08, 2025, 05:19:18 PM »
Hi - I have the following C# code:

Code: [Select]
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
        Physics.Raycast(ray, out RaycastHit raycastHit, float.MaxValue, instance.mousePlaneLayerMask);
        return raycastHit.point;

Basically it "follows" my mouse cursor and updates the game object position, so it looks like the game object is following the cursor on a plane.

So it's creating a ray from the main camera to the current mouse position, and then creating a raycast to see which point on the plane we hit, and then I update the objects position based on the hitpoint.

Trying to port this to playmaker, but I cant seem to find a ScreenPointToRay action? I did find a Raycast To Screen but I don't think that's the one and it doesn't return the hitpoint.

Any clues as to what the playmaker implementation would look like or what the equivalent ScreenPointToRay action is in playmaker?

cdutoit

  • Playmaker Newbie
  • *
  • Posts: 30
[SOLVED] Re: Translating ScreenPointToRay to Playmaker
« Reply #1 on: August 09, 2025, 11:34:36 AM »
Ah nevermind, solved.

Theres a RayCast From Screen action (I think I got it in the ecosystem browser). While it doesn't return the hitpoint, there is a subsequent GetRaycast Hit Info action to get the details