81
					PlayMaker Help / Translating ScreenPointToRay to Playmaker
« Last post by cdutoit on August 08, 2025, 05:19:18 PM »Hi - I have the following C# code:
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?
				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?

 
  
  
  
		 Recent Posts
Recent Posts . We have place number 39 at the Indie Arena Booth.
. We have place number 39 at the Indie Arena Booth.