You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func _integrate_forces(physics_state):
set_applied_force(thrust.rotated(rotation))
set_applied_torque(spin_power * rotation_dir) # this line is not working when shape is disabled
var state_transform = physics_state.get_transform()
if state == INIT:
state_transform = Transform2D(0, screensize/2)
if state_transform.origin.x > screensize.x + radius:
state_transform.origin.x = 0 - radius
if state_transform.origin.y > screensize.y + radius:
state_transform.origin.y = 0 - radius
if state_transform.origin.x < 0 - radius:
state_transform.origin.x = screensize.x + radius
if state_transform.origin.y < 0 - radius:
state_transform.origin.y = screensize.y + radius
physics_state.set_transform(state_transform)
When the player is in the INVULNERABLE state it doesn't rotate. Please note that spin_power * rotation_dir is correctly set to a correct value even in that state.
Thanks for the additional correction! As a side topic, do you know where can I find more info about why sometimes is necessary to use call_deferrend when calling methods in process?
Godot version:
3.2.2.stable.official
OS/device including version:
Kubuntu 18.04
Issue description:
As described in this issue:
#30551
After a RigidBody2D disables its CollisionShape2D, it cannot be rotated until the shape is re-enabled.
Steps to reproduce:
This is my player:
This is the
change_state
method of my player (you can see that INIT and INVULNERABLE disable collision):And this is the method used to rotate the player:
When the player is in the
INVULNERABLE
state it doesn't rotate. Please note thatspin_power * rotation_dir
is correctly set to a correct value even in that state.Minimal reproduction project:
https://bitbucket.org/lukepass/space-rocks/src/master/
Here is the zip: https://bitbucket.org/lukepass/space-rocks/get/7fad1b35ac35.zip
Please the the invulnerability timer to 10 seconds in the Player scene then run the game. Hit a rock and try to turn.
Thanks!
The text was updated successfully, but these errors were encountered: