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

TouchEnded fires before Touched -- by design?

Asked by 6 years ago
Edited 6 years ago

I am noticing that the TouchEnded event for a Part fires long before the Touched event, even if I've never touched the Part. Is this by design? I'm using a simple script to verify, and walking my character near and away from the Part in question:


script.Parent.Part.Touched:connect( function(collidingPart) print ("Touch Began for Part, collidingPart is " .. tostring(collidingPart)) end) script.Parent.Part.TouchEnded:connect( function(collidingPart) print ("Touch Ended for Part, collidingPart is ".. tostring(collidingPart)) end)

Edit: I updated the code to print the colliding part, and I'm getting these parts from my avatar as I move close to the object without touching it. Here is a top-down image of the situation: http://imgur.com/a/LREjd

Touch Ended for Part, collidingPart is RightHand

Touch Ended for Part, collidingPart is RightLowerArm

Touch Ended for Part, collidingPart is RightUpperArm

Touch Ended for Part, collidingPart is LeftHand

Touch Ended for Part, collidingPart is LeftLowerArm

Touch Ended for Part, collidingPart is LeftUpperArm

It appears that these parts (RightHand, LeftHand etc.) are indeed the closest parts to the colliding object, but they're still very far from touching.

0
type print(collidingPart) and tell us the results please Nowaha 459 — 6y
0
I've updated the question with this information, thank you very much for your help. vargonian 2 — 6y

2 answers

Log in to vote
0
Answered by
Nowaha 459 Moderation Voter
6 years ago

I do not think there is something you can do to fix this. The TouchEnded seems to be very glitchy ;/

I have tried several things to fix it in my own place but it just doesn't appear to be working in any way.

0
This is unfortunate, but at least I can write custom code to counter-act the glitchy behavior, since Touched seems a lot more reliable so I can leverage that. vargonian 2 — 6y
Ad
Log in to vote
1
Answered by 6 years ago

maybe because other parts in thegame

0
Possibly. Try printing the part that touched it. XAXA 1569 — 6y
0
I've updated the question with much more information. There are very few parts in the game; I intentionally made a bare-bones setup to eliminate extra parts interfering. vargonian 2 — 6y

Answer this question