'Is there a way to convert a physics object to a static object in phaser 3?
I'm attempting to have a player moved platform that becomes a static object when the player moved character lands on it (when collision is detected). This is so the platform wont move from underneath the character. Any help will be much appreciated, thanks :)
Solution 1:[1]
If you are using Phaser 3 and the Arcade Physics engine, you could use the setImmovable method, from the body object, here the link to the documentation.
Here's a link to a demo on the official phaser homepage link to demo, showing how it can be used.
Solution 2:[2]
You have a laravel tag and therefore I suggest using Carbon.
Example:
$dateOne = Carbon\Carbon::parse("19-01-2022 12:49:00");
$dateTwo = Carbon\Carbon::parse("19-01-2022 13:49:00");
$dateTwo->diffInHours($dateOne); //gives you 1
Notes:
You do not need to parse into Carbon if the column name is already mutated through $dates array in the model. https://laravel.com/docs/5.5/eloquent-mutators#date-mutators
Carbon documentation for reference: https://carbon.nesbot.com/docs/
Hope this points you in the right direction.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | user3532758 |
