I need a NPC to face towards a point while walking in another direction as if it’s using mouselock
My end goal is to get a NPC to sword fight like in the good ol days in sword fighting tournament.
EX: you walk with mouselock on and stab with your sword while moving to the side where your opponent has no sword
If your problem with using BodyGyros is the fact that it turns too slow, you can increase the MaxTorque and P properties on the BodyGyro until you get the desired rotation speed.
I’ve tried doing that, and increased the numbers to 7 septillion, but it doesn’t really change it at all. I’ve also tried using math.huge but then it just makes the character slingshot before i even get to see it at all.
I think the walking mechanics might be overpowering the bodygyro??? - Just a thought
Alternatively, you can literally just tween the humanoid very fast in the direction wanted using CFrame. That way it simulates a real movement that looks like shiftlock.
I have been using MoveTo this entire time, while randomly testing Move if it works also but when i am tweening the cframe like the other guy said it makes the character turn perfectly, although it makes the character not able to walk.
I belive the pathfinding service doesn’t make it move, rather just finds waypoints for you to make your character move towards with MoveTo, thus making it not any better for my scenario
If you uncheck the AutoRotate property of the humanoid then the Humanoid will stop trying to make the character face the direction it is walking in. You are then free to use BodyGyro to make it face whatever direction you want. If you need it to spin faster just decrease the D property of BodyGyro
When i tried that my character wasn’t rotating at all, and i decreased the D property to 0 and increased the max force by a lot and played with the P settings and it doesn’t turn at all. it just stays in the same position unless it bumps into a wall and the wall makes it rotate
Is the max force set very high on the Y axis? If it rotates freely when it hits a wall it seems to me that the gyro is not putting any force on it. Could you send us a picture of the character in your explorer window and show us a picture of the properties of the gyro and humanoid?
I found your problem. In your BodyGyro the MaxTorque for the Y-axis is set to zero. This is preventing the gyro from rotating the character in the direction you want it to.
Set the MaxTorque property to Vector3.new(0, math.huge, 0) and then it should rotate in the direction you tell it to.