Wittiest
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 9665 |
|
|
| 02 Aug 2017 09:53 PM |
http://wiki.roblox.com/index.php?title=API:Class/BasePart/GetTouchingParts
This plays shows an example of it working incorrectly: https://www.roblox.com/games/60084905/Display
The .TouchEnded event fires, and immediately after (up to around 2/15 of a second), :GetTouchingParts() returns incorrectly. It returns parts that were touching a moment ago.
This needs to be fixed so that we can hook :GetTouchingParts() to a .TouchEnded event.
|
|
|
| Report Abuse |
|
|
|
| 02 Aug 2017 10:04 PM |
| You could make your own function for this since it's broken |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2017 10:05 PM |
| Are you testing this with R15? |
|
|
| Report Abuse |
|
|
Wittiest
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 9665 |
|
|
| 02 Aug 2017 10:06 PM |
| I did. I am using this post as a referenced to explain the issue. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2017 10:07 PM |
| So this isn't a case of one part firing the TouchEnded event while there are still other parts connected right? |
|
|
| Report Abuse |
|
|
Wittiest
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 9665 |
|
|
| 02 Aug 2017 10:07 PM |
@very,
The issue is present with R6 and R15. It will be present in any situation with moving parts. |
|
|
| Report Abuse |
|
|
Wittiest
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 9665 |
|
|
| 02 Aug 2017 10:09 PM |
@very,
Nope. When I have two .Touched events and two .TouchEnded events, after the last of the 4 events (Touch, Touch, TouchEnded, TouchEnded), it still finds a part with :GetTouchingParts() immediately after the last event has fired. |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
| |
|
Wittiest
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 9665 |
|
|
| 02 Aug 2017 10:11 PM |
| @amanda, The place is uncopylocked. But here: Part = script.Parent i = # # # # ################################## i = i + 1 print("Touched: "..tostring(i)) Part.TouchEnded:wait() j = j + 1 print("TouchEnded: "..tostring(j)) local objs = Part:GetTouchingParts() for _, obj in ipairs(objs) do print(obj) end end) Example of one of the bad outputs I received: Touched: 1 Touched: 2 TouchEnded: 1 Right Leg TouchEnded: 2 Right Leg |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 02 Aug 2017 10:11 PM |
| OP's test place is uncopylocked @amanda |
|
|
| Report Abuse |
|
|
amanda
|
  |
| Joined: 21 Nov 2006 |
| Total Posts: 5925 |
|
|
| 02 Aug 2017 10:19 PM |
| this is actually an effect of TouchEnded being broken, and not GetTouchingParts. |
|
|
| Report Abuse |
|
|
Wittiest
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 9665 |
|
|
| 02 Aug 2017 10:20 PM |
@amanda,
Could you explain? It seems that .TouchEnded fires correctly and :GetTouchingParts() just updates a bit later. |
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 02 Aug 2017 10:31 PM |
@wittiest
because GetTouchingParts likely uses the .touchended event and has an array of touching parts.
|
|
|
| Report Abuse |
|
|
RomDino
|
  |
| Joined: 04 Jul 2015 |
| Total Posts: 2795 |
|
|
| 02 Aug 2017 10:33 PM |
TouchEnded is broken since 2012 and Roblox haven't even fixed it
I didn't touch the part how can it fire the TouchEnded? |
|
|
| Report Abuse |
|
|
Wittiest
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 9665 |
|
|
| 02 Aug 2017 10:34 PM |
| So I'm assuming this means it won't be fixed? |
|
|
| Report Abuse |
|
|
RomDino
|
  |
| Joined: 04 Jul 2015 |
| Total Posts: 2795 |
|
|
| 02 Aug 2017 10:36 PM |
Sadly, yes.
Unless Roblox notice this and upgrade their studio bugs |
|
|
| Report Abuse |
|
|
Wittiest
|
  |
| Joined: 02 Mar 2009 |
| Total Posts: 9665 |
|
|
| 02 Aug 2017 10:40 PM |
| Making a custom version of :GetTouchingParts() with .Touch and .TouchEnded works. So that's what I'm doing for now. |
|
|
| Report Abuse |
|
|