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

The Touched Event is too slow?

Asked by
Griffi0n 315 Moderation Voter
6 years ago

So I have a brick in my game that has some Touched Event code. The script is a server-side script and my game is FE. The problem comes when I change the velocity of the brick. What happens is the Touched Event takes longer to recognize that the character is there than when the character starts moving due to velocity. If I move the script to the client then would that help? Are there other ways to prioritize the Touched Event?

1 answer

Log in to vote
1
Answered by 6 years ago

First try to add a

print("Some random text")

to the beginning of the event script, to see if Touched is really delayed. You can tell if the text has a delay displaying after you touched it, there is a problem. Otherwise, there is nothing wrong with the event, maybe the BodyVelocity doesn't activate immediately or there is something wrong with the script. Hope I helped!

0
Just to add to this answer, BodyVelocity (if that's what you are using) applies a force that accelerates until something is a certain speed. A larger P makes it accelerate faster http://wiki.roblox.com/index.php?title=API:Class/BodyVelocity. This answer assumes the Touched event is not actually slow however. User#18718 0 — 6y
0
I agree with you. Just another note is that if PGS is enabled, the P value is ignored. Thank you very much for adding to my answer! DatOneRandomDude 69 — 6y
0
I realized the problem and it wasn't due to velocity but might have effected by it Griffi0n 315 — 6y
0
Hi, was wondering how you had fixed this as I am also having similar issues. KossmoZ 4 — 6y
Ad

Answer this question