I'm trying for an MS-DOS style game with ascii art, and to do this I have a resolution of 640x360, an 8x8 font, and I'm trying to snap everything to 8x8 cells with the following line of code attached to a node, whose child is the Label node visible on screen. You can see in the video that this results in a small twitching effect. This effect was much greater before I rounded the value (it twitched 4 pixels rather than 1) but it still remains.
#Node twitching on screen when I try to snap it to 8x8 cell
1 messages · Page 1 of 1 (latest)
this is the scene tree for the moving cat. the characterbody2d and its collider move smoothly but are not visible, whereas the visible elements are packaged under the staticascii node
this is the whole script for the cat, by the way. i tried going back and forth between process and phyiscs process and the effect remains
i was wondering if what gets displayed on screen somehow happens more frequently than once a frame, but that doesn't make sense
One reason for this could be that you set your label position before moving the root, so pos is applied > velocity is applied / render = pos+vel*dt (wrong) - maybe try to use the https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-property-process-priority on your script node to ensure it's processed after? (else you can detach your label & set another non-moving node as its parent - it may be better to have all your invisible nodes in a tree and the visuals in another if you want them independent)
Godot Engine documentation
Inherits: Object Inherited By: AnimationMixer, AudioStreamPlayer, CanvasItem, CanvasLayer, EditorFileSystem, EditorPlugin, EditorResourcePreview, HTTPRequest, InstancePlaceholder, MissingNode, Mult...
unfortunately setting process priority higher didnt seem to resolve the issue