mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Merge pull request #5922 from dalexeev/fix-click-and-move-example
[3.x] Fix click-and-move example
This commit is contained in:
@@ -295,7 +295,7 @@ on the screen will cause the player to move to the target location.
|
||||
|
||||
export (int) var speed = 200
|
||||
|
||||
var target = Vector2()
|
||||
onready var target = position
|
||||
var velocity = Vector2()
|
||||
|
||||
func _input(event):
|
||||
@@ -317,9 +317,14 @@ on the screen will cause the player to move to the target location.
|
||||
{
|
||||
[Export] public int speed = 200;
|
||||
|
||||
public Vector2 target = new Vector2();
|
||||
public Vector2 target;
|
||||
public Vector2 velocity = new Vector2();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
target = Position;
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (@event.IsActionPressed("click"))
|
||||
|
||||
Reference in New Issue
Block a user