![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | daniel500013 |
Hi i made script to make camera movable by mouse wheel but when i tried move camera by my middle mouse button camera move out of main scene so here is my question how can i set my camera speed? Under i give my simple script
bool move
public void MoveCamera(InputEventMouseButton eventMouseButton, InputEvent @event)
{
if (eventMouseButton.ButtonIndex == (int)ButtonList.Middle && @event.IsPressed())
{
move = true;
mouse = GetLocalMousePosition();
}
else
{
move = false;
}
}
public void MoveCamera()
{
if (move)
{
GlobalPosition = (GlobalPosition + mouse);
}
}
public override void _Process(float delta)
{
MoveCamera();
}