Tune in here this Saturday at 2pm Eastern Time to watch the staff play the Game Jam submissions and give their input with the community!
Vote now here!
← Blog Home

All About Deprecation

Deprecation is a topic you'll hear often. Everyone will tell you that deprecated items should be avoided, but why?

Objects, properties, methods or events that become deprecated could be removed at any time by ROBLOX, because you're not suppose to be using them anymore anyways. Normally deprecated items aren't removed instantly to give people time to become used to new methods, or so they don't break older games.


Why are items deprecated?

Items can be deprecated for many reasons. The most common reason is that the item has been superseded, or replaced. Other times items can be deprecated because they don't fit with ROBLOX standards, or if they contain a typo.


How do you know if an item is deprecated?

To tell if an item is deprecated all you have to do is check the wiki! Simply look up your item's name on the ROBLOX wiki, and on the page it will tell you if the item is deprecated at the top. If it is, you should see this,

Example

There's also this article, or the 'deprecated members list '.


Common Examples

Use Destroy(), not Remove()

Remove() did serve a purpose, but now it's deprecated in favor of Destroy(). This is because Remove() left the Instance it was called on still existing, just with no parent. The Destroy method now locks the parent of the object it was called on to nil and prepares it for junk collection. This blog explains more about it.

Stop using Mouse Key Events

While the mouse is capable of processing user key presses, it has been deprecated for a good reason. Two new services are now available, being UserInputService and ContextActionService, which offers much more flexibility when processing user actions in the form of an input object. This object includes more in depth information about the action such as state, type and key pressed. These services can also process actions from devices, controllers and virtual reality.

Don't use Hopperbins

Hopperbins used to be the only thing that worked without a handle, but now tools have the RequiresHandle property, and have therefore superseded Hopperbins.


Capitalization Of Methods

There are several methods that have been deprecated because of their capitalization. Their capitalization being camelCase, or lowerCamelCase. Examples would be waitForChild and findFirstChild. ROBLOX tries keeping their methods PascalCase, or UpperCamelCase. Other deprecated methods that most don't know about are listed here.

Posted in Scripting Tips

Commentary

Leave a Comment

Pyrondon says: December 29, 2016
Thanks for this post.
udayk8139 says: January 1, 2017
Nice :D
kudorey619 says: January 3, 2017
Very useful!
FiredDusk says: January 4, 2017
Hi
Ad