local Part = Instance.new("Part",workspace)
local BodyVelocity = Instance.new("BodyVelocity",Part)
BodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BodyVelocity.Velocity = Vector3.new(math.huge,math.huge,math.huge)
Part.Touched:Connect(function(touch)
if touch:IsA("Part") then
print('light speed is touched ')
end
end)
COMMUNITY QUESTION
Is it possible to get a touched event to fire for a object traveling at math.huge speed?
1 answer
Looking at one of your previous forums, I'm assuming this question links with avoiding the use of raycasting.
To answer your question, probably no.
Raycasting advantages
- If you were to use a part to fire through a small hole, it would probably have to be a small size in order to do so. Raycasting can go through these small holes just fine.
- Raycasting is more consistent. Using ROBLOX physics can lead to inconsistencies, I will not elaborate further. Raycasting is very straight forward, no randomness.
- Less lag. The server has to replicate each moving part in the workspace to every client. The server also does the calculations for moving parts, applying physics to every unanchored object. Too much objects leads to the server 'overloading' overall causing lag.
- Less costly. The touched event fires every time it touches something. You have to use multiple
if statementsto check if it's a character making it costly in the functions it has to use. Raycasting is a one time thing. - Can do the same things as touched projectiles except at a lower cost. Phantom Forces uses raycasting for their bullet travel projectiles.
There is no reason to avoid learning things. You are limiting yourself to what you feel comfortable with. Raycasting opens lots of doors that the touched event can't even reach. Until you apply raycasting to your scripts, you will never learn raycasting and be stuck with the Touched event and its limitations.
Good luck. Learning takes time and effort, don't give up!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
why would you want a part to go at a velocity of 2^1024 - 1?
For what reason would you need a light speed object to touch something?