Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

OnTouched script logic and bypass help?

Normally I would use something like this:

function Touched(hit)
	if hit.Anchored == true then	
		script.Parent.Parent.Parent.Hull.Front.Value = true
		print("ANCHORED front")
	end
end

function TouchEnd()
	script.Parent.Parent.Parent.Hull.Front.Value = false
	print("not anchored front")
end

script.Parent.Touched:connect(Touched)
script.Parent.TouchEnded:connect(TouchEnd)

But this only detects when any brick TOUCHES its face. Is there anyway to alter this script into saying "if it detects a anchored brick within the 5 studded bricks volume, turn front.value to true" not just the surface?

1 answer

A good idea is to make a transparent block surrounding it out from 5 studs on each side that connects to the brick. Do you know what I mean?

2 comments

0

Thats exactly what I did, but it only calculates when it touches its FACE not its volume. I want the bool to be true when a anchored part is in that bricks volume.

0

Try using a blockmesh maybe

This discussion is preserved as it was. New answers, comments, and votes are closed.