object_set_solid( index, solid );
|index||The index of the object to change.|
|solid||The new solidity of the object (true=solid, false=not solid).|
With this function you can flag a specific object as being solid
or not (for more information on the "solid" flag see Defining
Objects). This means that all instances of this object that are
created after solid has been changed will be created with
this new state, while instances that are already in the room may
not be affected.
Please note that this is not an instance function! You can set the solid flag of individual instances using the solid variable and so have ten instances all flagged as solid even though the object in question has the flag set to false in the IDE, and even if you change the solid flag of the object to true using this function, all instances that currently in the room will remain as they were, and only instances created after calling the function will start with solid flagged as true.
if !object_get_solid(obj_Block) object_set_solid(obj_Block, true);
The above code checks the solid flag of the object "obj_Block" and if it is false then it is changed to be flagged as true.