answersLogoWhite

0

How do you deactivate an object?

Updated: 9/13/2023
User Avatar

Wiki User

8y ago

Best Answer
Instance DeactivationDeactivating objects is a very useful feature in Game Maker. It is an easy way to reduce delay, freeze-ups and speed up the overall number of frames per second. Deactivating objects is easy, but there are a few things to keep in mind: Deactivated objects are unaccessible and invisible, or in other words they are treated like they don't exist until you reactivate them. Here are the functions for deactivating and reactivating objects:

instance_deactivate_object(object_name);

instance_activate_object(object_name);

A handy trick for making 2 objects not interact with each other goes as follows: (This is especially useful when you want an object to ignore the other when using the move_contact_all()function)

instance_deactivate_object(the_other_object's_name);

//STEP EVENT

instance_activate_object(the_other_object's_name);

Note: This won't affect the objects in any way apart from them both not interacting. Put that code in both objects' step events and you're good to go.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you deactivate an object?
Write your answer...
Submit
Still have questions?
magnify glass
imp