Question / Fact
So if yall dont know godot as recently added the ‘VirtualJoystick’ node.
I wanted to try it as like im developing recently on my tablet. (Ive always done mine or used a godot extension) but the problem is that when you use it the characters position is so crooked and scattering. Also ive done the ‘3D follow mouse’ system and the problem with it is that the mesh thats following the mouse will follow also the finger thats holding the stick.( i only want the one outside the sticks area) is there a way to fix this new node?
Ok so i did fix the movement. Now its smooth but i still have the problems i said…
What does this mean? “Scattering” and “crooked” doesn’t seem like an adjective that applies to a single position.
Is “3D follow mouse” relevant to the virtual joystick issue you are having? What is such a system anyways?
Maybe you could post some code or a video of what you are seeing?
So as i said ive fixed the problem with the movement but im sorry if it wasnt understandable. The thing i want is that when the thumb uses the joystick i dont want the mesh to follow it. I just want it to follow the finger that isnt in the joystick area.
Heres the code of the mesh following the mouse:
extends Node
func _input(event: InputEvent) -> void:
if Input.is_action_pressed:
shoot_ray()
func shoot_ray():
pass
func _process(delta: float) -> void:
var cam := %caamm
var mouse_pos = get_viewport().get_mouse_position()
print(mouse_pos)
var rayStart : Vector3 = cam.project_ray_origin(mouse_pos)
var direction : Vector3 = cam.project_ray_normal(mouse_pos)
var plane := Plane(Vector3.UP)
var intersection = plane.intersects_ray(rayStart, direction)
print(intersection)
if intersection:
%idk.global_position.x = intersection.x
%idk.global_position.z = intersection.z
%moseu.position = get_viewport().get_mouse_position()
The joystick i only used the settings the node had. And i cant find anything for stopping this thing.
You can set the VirutalJoystick mode to “Fixed” so it only functions when you directly touch it. You could also use “Dynamic” which will move the joystick to the initial touch point, so long as it’s within bounds, this usually feels much better.
Maybe you have the joystick set to “Dynamic” or “Follow” but you’ve made the joystick cover the entire screen? What does your scene look like?
Or is this about the script always processing, and you want it to not process if the virtual joystick is in operation? If so you can use the joystick’s pressed and released signals to toggle the processing of your mouse-based node with set_process(true/false)