Lag when setting position

Godot

4.2

Question

Im currently rewriting my project in C# and i have a light2d that has its position set to the mouse location on _Process. The same code in GDScript gave me the desired result IE the sprite is “glued” to the mouse location. The same logic in C# has a very laggy appearance and trails well behind the actual mouse location… Is this due to the marshalling overhead? Would i be better served just keeping that script GDScript?

I turned off VSync and it made a huge difference. I tested the performance of both after turning it off and oddly it seemed C# was slightly faster at keeping the position adjusted when moving the mouse fast.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.