How can I tell if the mobile joystick is pointed forwards

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to tell if the mobile joystick is facing forwards for a run system
  2. What is the issue? Include screenshots / videos if possible!
    No idea how I can do this
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    No one has ahd the same problem
4 Likes

Could you try Humanoid.MoveDirection?. This option isn’t only for mobile but it could work.

4 Likes

How would I utilize this too see if the player moves forwards?

2 Likes
if Humanoid.MoveDirection == Character.HumanoidRootPart.CFrame.LookVector then
--line of code
end
1 Like

maybe this will work

charlimits

1 Like

This doesn’t work whatsoever, I need something better

1 Like

How exactly should I use this?, explain please

1 Like

Humanoid.MoveDirection is a Vector3 and detects the direction the player is moving in. If it isn’t moving, it will be set to 0, 0, 0.

1 Like

I will try and find how to do this. I’m currently testing this on a roblox game.

1 Like

thank you very much for your helpfulness

1 Like

No problem!

robloxcharlimits

1 Like

What in the world is robloxcharlimits???

1 Like

Oh no don’t worry. I used that cuz roblox’s character limits are 30. So my sentence was too short by itself.

1 Like
local roundhumanoidmd = Vector3.new(math.round(humanoid.MoveDirection.X), math.round(humanoid.MoveDirection.Y), math.round(humanoid.MoveDirection.Z))
local roundlookvector = Vector3.new(math.round(char.HumanoidRootPart.CFrame.LookVector.X), math.round(char.HumanoidRootPart.CFrame.LookVector.Y), math.round(char.HumanoidRootPart.CFrame.LookVector.Z))
if roundhumanoidmd == roundlookvector then
	--code
end

I rounded both Vector3s and checked if there are equal, meaning that the character is walking forwards.

Remember to define char.

1 Like

thank you, it works very well.

1 Like

No problem!

robloxcharlimits

1 Like

You might want to loop it or do :GetPropertyChangedSignal() to both Humanoid and HumanoidRootPart as the position will keep on changing.

1 Like

Like this,

1 Like

I just needed to find out wether they were moving forwards once. after that it doesn’t matter. I just check everytime they want to sprint.

1 Like

oh ok. Don’t worry about it then.

1 Like