Godot Version
Version 4.5
Question
I am making Pong but I cannot update player's position to new position in Ready function. I don't understand if it is clashing with something.
Code
using Godot;
using System;
public partial class Player : CharacterBody2D
{
private int speed = 200;
public override void _Ready()
{
Position = new Vector2(50, 90);
}
public override void _PhysicsProcess(double delta)
{
walk();
MoveAndSlide();
}
public void walk()
{
float moveV = Input.GetAxis("ui_up", "ui_down");
Vector2 nPo = new Vector2(Position.X, moveV);
Velocity = nPo * speed;
}
}
Kindly help me,