#Can't detect touch
1 messages · Page 1 of 1 (latest)
what script are you using
** You are now Level 6! **
you're probably using normal script cuz u use heartbeat
but if you are using local then remove heartbeat and replace it with renderstepped
also try to use datastore
if touched isn t working
i don't understand
💀

oh im not?
you just trying to help brah
I'm using a server script, as I said the part is working as it should, following the closest player, it detects touches with the baseplate and the player but not with the part I made myself
where do you keep ur missle part
also pls share script
How would I use datastore to detect parts touching?
wait no i meant region3
cuz datastore only stores data
ur part needs to be 3D
im trying to send the code as a code thing hold on
** You are now Level 5! **
do you think im using a 7D Workspace?
send IT
OKAY IM SENDING IT SORRY

im trying to find the thing on my keyboard
okay zark
bro im freaky if you don't send it
omg
bro im gonna legit while true do without any task.wait right now bro
lol
hi so I got muted for a minute for sending the code
im freaking it bro
local runService = game:GetService("RunService")
local part = script.Parent
local speed = 0.1
local distances = {}
part.Touched:Connect(function(hit)
print("touched", hit.Name)
end)
runService.Heartbeat:Connect(function()
--find closest player
local smallestDistance = math.huge
local closestPlayer = nil
for _, player in pairs(game.Players:GetPlayers()) do
local playerDistance = (player.Character.PrimaryPart.Position - script.Parent.Position).Magnitude
distances[player] = playerDistance
end
for player, distance in distances do
if distance < smallestDistance then
smallestDistance = distance
closestPlayer = player
end
end
part.CFrame = CFrame.new(part.Position, closestPlayer.Character.HumanoidRootPart.Position) * CFrame.Angles(0, math.rad(90), 0)
part.CFrame *= CFrame.new(speed, 0, 0)
speed *= 1.0002
end)
I changed some words that were apparently blocked
VRO
bro what the fuck
did you read what I need help with? 😭
i havent even find the shit yet
BRO
but you don t like error
ok imma try this on rblx studio rq
smallestDistance = Distance
and has cancollide on
ill say this in the most respectful way possible, do you script on roblox?
what did i even do
then why mention it 😭
@simple jacinth get freaky on him
oaky ):<
enlighten us zark kun
really?
for me its not even detecting the baseplate
it only detects the parts from the player
use humanoidrootpart
it was detecting the baseplate when I tried it
that part is working as it should
everything inside heartbeat is working as it should
the problem is on in the touched function
ok? fairly simple to fix
just add the partname
that u want to detect specificly
okay
so uh
i searched on roblox studio forum
it says
using cframe
is kind of unreliablel
for touch shits
diddyahh
use the new roblox studio Ai
instead use bodyvelocity
its gonna make the part movement much smoother
and i think its gonna be able to detect touches
alright but one thing
from anywhere
lolololololol
I did a little test just now
yea yea
unanchored the parts that I want it to collide with
omagawd
and it detected the touches but only when it touched the sides
OMAGAWD
BECAUSE IT IS THE BEST
ok PrcaiteMaster9000
so, body velocity
and set the velocity to point to the closest player
thank you sir zark
dont thank me
try it first
💀
bro i master in ui not these shit
ggez

or linearvelocity
dont really know about velocity doe
just search in the dev forum fr
learn the properties
actually i thnk body velocity is deprecated
oh wait
** You are now Level 5! **
yeah
or vector force
linear velocity
In this video I compare Linear Velocity, Vector Force and Assembly Linear Velocity. Use the right constraint for the right job.
https://create.roblox.com/docs/en-us/reference/engine/classes/LinearVelocity
maybe you should watch this to get a better understanding
dw I've used them before
alright -central cee

thank you sir zark kun