WorldRoot:FindPartOnRay is lacking information about return arguments

There’s no summary for the return arguments below:
https://developer.roblox.com/en-us/api-reference/function/WorldRoot/FindPartOnRay

Screenshot:

This makes it difficult to use the method. The user must manually figure out the return arguments, which defeats the purpose of documentation existing in the first place.

18 Likes

All of the Ray casting based documentation needs updated. I’ve been trying to utilize ray casting for a month or so now and I’m having the hardest time because I have to search all over the place to find info on return variables, usage examples, parameters, etc… There is also confusion as to what instance these functions belong to: worldroot or workspace.

3 Likes

I agree, this is terrible for new developers especially, where as more experienced ones already have some general knowledge regarding the function arguments.

Simple documentation like this should not require a DevForum search in order to find relevant information.

2 Likes

Edit
From what I have found digging into this topic…
FindPartOnRay returns

  1. the part hit
  2. the part position
  3. the part lookVector
  4. the part material

I haven’t found much more info than that yet, hope this helps someone… If any other information came along I would love to see more myself.
End Edit
I hope this is a better, more acceptable post. Thank you @Mi_sst

So any luck on finding this information ?

4 Likes

I was trying to look into this and ran into the same bizarre problem.@IvanEOD tysm for the return tuple information.

I haven’t been keeping up with Roblox updates recently, so this might be common knowledge, but weren’t there also more Raycasting functions under Workspace such as one with a whitelist and one with an ignore list?

1 Like

I hope this gets fixed soon. Meanwhile here are the old wiki docs about the ray functions grabbed with the wayback machine:
Workspace:FindPartOnRay()
Workspace:FindPartOnRayWithIgnoreList()
Workspace:FindPartOnRayWithWhitelist()

1 Like

Good idea, I didn’t think about looking at the archive. Archived wiki seems consistently more useful than the current one, which is frankly always disappointing.

3 Likes

Its pretty sad we have to resort to this to figure out what it returns. It should be common sense to document what a function returns when your creating documentation for it…

This issue has neither been acknowledged nor rectified since the forum post on November 28th - 47 days ago.

We’ve identified the problem that lead these pages to be blank: this was caused by an update wherein API members were moved from a class to an abstract superclass (Workspace now inherits from the abstract WorldRoot). We use an automated tool that imports the current members of the Roblox API, but it doesn’t recognize “movements” of API members, only additions and removals. In other words, it noticed the removal of Workspace:FindPartOnRay and the addition of WorldRoot:FindPartOnRay, but it was not designed to migrate content. This is why the information disappeared from the DevHub.

Changes like this (API member movements) happen extremely rarely. This didn’t change any existing behaviors, as you could still use Workpsace:FindPartOnRay the same way - so that’s why this got put under low priority. We apologize for the inconvenience. The content will be migrated by hand from the previous pages this week.

5 Likes

I’m still not able to see any return arguments. Has the change not been rolled out, or is the webpage cached?

1 Like

@Ozzypig It’s still not displaying the return results
https://developer.roblox.com/en-us/api-reference/function/WorldRoot/FindPartOnRay

image

1 Like