Scripting Helpers is winding down operations and is now read-only. More info→
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 7 years 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 4988 — 7y
0
Touched event works fine with terrain GixxerK3 20 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Should work just fine except that you should change

print(Terrain)

to

print(Terrain.Name)
Ad

Answer this question