How do I find the model the player is walking on?

So I was wondering how would I find the model the player is walking on and prints name so if the player was walking on a model called “Cheese” then it would print “Cheese” Untill they walked of it and so on…

I was thinking is there a way to do this without using raycasting like does roblox have a API no one knows about that’s called something weird but would do what I need?

any help is welcome.

2 Likes

You could put a hitbox in the model and use a touched event on the hitbox

3 Likes

I did try that in the past but my script creates a model and the inserts parts into it but for some reason the models pivot wasn’t in the centre and when I tried using math to get the center position it just always had a offset.

1 Like

You can use Raycasting.

Raycasting allows you to send a ray towards any direction, it’s like a bullet, when it stops it returns where it stopped, which part it touched when stopping, etc…

You can place a ray in the character’s HumanoidRootPart and shoot it towards the floor. Just get the part that collided with the ray and check if it’s inside the model. It’s easy!

I did something similar some time ago:

1 Like
1 Like

I don’t think there’s a better way to implement this without using raycasting. Raycasting is the best option for this example, just a quick question, why don’t you want to use raycasting?

1 Like

Dont ask me, ask the OP.

1 Like

Its not that I don’t want to use it I just don’t really have experience with it and I was wondering if there is a better why to do it without using raycasting

1 Like

I’ve read your past messages and you’ve mentioned that you don’t want to use a hitbox around the model because it messes up the pivot. But have you heard of Humanoid.Touched? This behaves the same way as BasePart.Touched but instead it checks if a part touched any of the character’s limbs. This might be a solution to your problem.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.