Ad
Log in to vote
0

Trying to make a script that checks if the part is touching terrain, Is this even close?

Asked by 1 year ago

This is a function that's part of a bigger script but the function is supposed (when called) to check if specific parts of a model are touching the terrain. I'm starting with just one part though to test the concept. Here is what I have so far, and the variables probably won't make sense without seeing the rest of the script but i'm trying to keep it simple. So to simplify I want to check if Floor is touching Terrain. Am I close?

function check_grounded()
    local player, char = get_pc()
    local Floor = char.EXAMPLE.Floor
    local Terrain = workspace.Terrain

        Floor.Touched:connect(function(Terrain)
  print(Terrain)
end)
        end

0
The Touched event isn't gonna work with terrain, unfortunately. Perci1 4842 — 1y
0
Touched event works fine with terrain GixxerK3 15 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

Should work just fine except that you should change

print(Terrain)

to

print(Terrain.Name)
Ad

Answer this question



Ad