Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I make a beam lock onto a torso?

Asked by 6 years ago

I want to be able to make a model which when you come into the distance of at least 6 studs then a beam appears and locks onto a players torso. And if more players come in then the beam is duplicated into two with one going to one player and the other beam to the other player. If you can help me thank you.

0
Well I found how to make it lock onto the torso on touch but I want it so if your in a certain distance it will do it oshawat00 62 — 6y

1 answer

Log in to vote
0
Answered by
PlaasBoer 275 Moderation Voter
6 years ago
Edited 6 years ago

You get the distance by minus first position with second position then use magnatude.

e.g

local distance = (part1.Position - part2.Position).magnitude

--distance is now the distance between the two Vector3

What I was thinking add a cylinder around the model so when the person touches that cylinder the beam apears to him.

0
And also add a check if distance is <= 6 MooMooThalahlah 421 — 6y
Ad

Answer this question