Raycast and Textures

Is it truly impossible to get texture colors with raycast or are there any methods to achieve this?

1 Like

Raycasts get the thing that it hits. With that you can do something like hit.Color3, hit.Position, ect.

If you needed to, you can send things to the server/client via remote events.

Could you specify your goal/use case? I can give general info, but if I know what you want to achieve, like maybe a hitmarker from a gun, then I could give better info?

1 Like

if Raycast hits a part, the script can search for its children. If it has a ‘texture’ obejct, you can use either FindFirstChild or FindFirstChildOfClass to check the texture, this is how you locate it:
0. Place the texture inside of the part

  1. Define the hitpart
  2. Use FindFirstChild or FindFirstChildOfClass to see if the part has the texture or no
  3. If it has, you can just say: hitpart.Texture

If you mean use a raycast to get the color at the intersection point, and not just the color of the part or surface, you can’t do this.

4 Likes

Might want to bump this to #feature-requests as I find that this could actually be very useful in some cases

bump as in just make a post there? kinda new to this whole forum thing.

Yep. I think this would be a cool feature if Roblox proceeded to do something with it.