generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: :GetTouchingParts() is broken

Previous Thread :: Next Thread 
Wittiest is not online. 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
AlreadyPro is not online. AlreadyPro
Joined: 24 Feb 2012
Total Posts: 2463
02 Aug 2017 10:04 PM
You could make your own function for this since it's broken
Report Abuse
veryveryveryhidden is online. veryveryveryhidden
Joined: 16 Dec 2012
Total Posts: 486
02 Aug 2017 10:05 PM
Are you testing this with R15?
Report Abuse
Wittiest is not online. 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
veryveryveryhidden is online. veryveryveryhidden
Joined: 16 Dec 2012
Total Posts: 486
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 is not online. 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 is not online. 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 is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
02 Aug 2017 10:09 PM
show your code
Report Abuse
Wittiest is not online. 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 is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
02 Aug 2017 10:11 PM
OP's test place is uncopylocked @amanda
Report Abuse
amanda is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image