Skip to content

Commit 6ba911e

Browse files
committed
DTC - Don't _process on player in editor
1 parent 0626d94 commit 6ba911e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/dodge-the-creeps/rust/src/player.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use godot::engine::{AnimatedSprite2D, Area2D, Area2DVirtual, CollisionShape2D, PhysicsBody2D};
1+
use godot::engine::{
2+
AnimatedSprite2D, Area2D, Area2DVirtual, CollisionShape2D, Engine, PhysicsBody2D,
3+
};
24
use godot::prelude::*;
35

46
#[derive(GodotClass)]
@@ -58,6 +60,12 @@ impl Area2DVirtual for Player {
5860
}
5961

6062
fn process(&mut self, delta: f64) {
63+
// Don't process if running in editor. This part should be removed when
64+
// issue is resolved: https://github.com/godot-rust/gdext/issues/70
65+
if Engine::singleton().is_editor_hint() {
66+
return;
67+
}
68+
6169
let mut animated_sprite = self
6270
.base
6371
.get_node_as::<AnimatedSprite2D>("AnimatedSprite2D");

0 commit comments

Comments
 (0)