I’m currently in the process of making a custom joystick for mobile users.
I’m trying to covert joystick position to where the player looks.
I’m not sure how I should tackle this problem but I’ve run across the :Dot function and thought that might be how I accomplish it I’m just not sure how to implement it.
Joy stick (Please excuse the for some reason horrible video quality, please tell me if I should re-record it):
Thank you so much if you could help! <3
Also, tell me if I need to further elaborate!
I don’t think the dot product will help you here. I’m not completely sure about the kind of thing you want. If I understand correctly, you could just use right/left/up/foward etc. unit vectors and make a kind of tweening system where you incrementally move the camera towards that unit vector based on the direction they moved the joystick.
Are you trying to make it so that the player looks in the direction the joystick is at? If so, .Unit would help.
Doing: (centerPos - joystickPos).Unit will get the direction to look at, and from there you just need to set the character’s look direction. If the joystick position is at the center, you’ll get an infinite vector, so throw in a check to make sure that at least one component of the vector difference isn’t zero.