Deactivate collision on individual locations
See original GitHub issueHey there. What would be the best approach to deactivate/activate collisions for an individual Position[] dynamically? My use case is the following:
As shown in the image, I have predefined slots (1) where buildings can be constructed. So what I do is that I’ve already created the tiles for the building but used setVisible(false)
on them. So at that moment those invisible tiles should be non-collidable. When the player interacts with the building sign (2) and starts construction, the visibility is set to true and the alpha slowly transitions from 0-1. Now the collisions should be available. Once the construction is done (3) everything is as usual
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to disable collisions between objects, but keep the trigger.
For detecting nearby players with a trigger collider, put the collider on a separate GameObject and give it a different layer that can...
Read more >disableCollisionWith - Bohemia Interactive Community Wiki
Description: Disable collision between provided objects. The collision is always disabled for both objects in the arguments.
Read more >Disabling collisions for an individual object - Construct 3
I have copies of Object A in one layout, but I want to disable only the collisions with an Object B but in...
Read more >JavaScript, Matter.js: Disable collision for one body
As already mentioned in the title, I am looking for a way, to disable every collision of a body in Matter.js. It should...
Read more >Deactivate collision between certain Rigidbody objects?
In those cases, you can create rigid body constraints between objects to disable collision between the two, via the "disable collisions" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You canmake a reference to the tilemap you’ve created on your scene and the layer of the specific tiles you want to deactivate collision on.
Set tile index to a non-colliding tile on targetLayer
This appears to update grid engine as well since it uses a reference to the tilemap.
That’s interesting. Unfortunately in Tiled you can only set properties in the tileset and not for individual tiles afaik. But in phaser you seem to have more freedom.