If you are specifically lookingįor the instance of the object running the code, or it's not important, it can be left as false.
#Game maker studio 2 movement code
You may need to check for collisions with an object that has the same index as the object that runs the code, so to prevent the code finding a collision with itself, you can set this to true. If false then collisions will be calculated based on the bounding box of the object to be checked Marked for its collision detection in its mask properties) which is a slightly more complex task for the CPU and so should be used with caution. If set to true, then precise collisions are to be calculated (but only if the object being checked for has "precise" This can be either true or false and relates to the precision of the collision checking. Parent of other objects, then all children of that object will be included in this check too. It is also worth noting that if the object type chosen is the designated It can be an instance id, an object type, or the special GM keyword all. This is where we specify the object that the function has to check for a collision with. These collision functions all work slightly differently but they maintain three common arguments The following routines can be used for this (as well as other functions detailed in the sections relating to Moving Around and Instances).
![game maker studio 2 movement game maker studio 2 movement](https://static.filehorse.com/screenshots/developer-tools/gamemaker-studio-screenshot-04.png)
The following functions deal with the various ways in which you can have an instance check for collisions with another instance: Any non-integer values will be rounded to the nearest integer. IMPORTANT! All collision functions work using integer positions, regardless of the input values. GameMaker Studio 2 has a number of built in functions to help you deal with collisions correctly and in accordance with the needs of your project.
![game maker studio 2 movement game maker studio 2 movement](https://vkehe45v84w20n29n1m63wok-wpengine.netdna-ssl.com/wp-content/uploads/2019/12/Editor_01-1024x555.jpg)
When planning motions or deciding on certain actions, it is often important to see whether there are collisions with other objects at certain places within the game world, and often choosing the right collision for the job is the most important task