I want the character to be limited to around 240 degrees of head movement. More than that should be blocked, so my Robloxian doesn’t get its neck snapped. I can’t find anything to help with my issue so I just posted it here.
You could probably calculate the relative angle compared to the HumanoidRootPart. If said value is above your restriction, snap it back to your max rotation.
This might require .RenderStepped(), I don’t know how resource intensive this is.
That’s interesting.
You could still use the torso in that case, it will be “more” relevant anyways, since the neck is connected to the torso rather than the HumanoidRootPart.
@ifkpop is correct, you could calculate the Dot Product from a certain “forward facing” vector, calculated by a HumanoidRootPart, Torso, or even just a new part where the player’s head would be.
Based on this you can find the angle between the Camera’s LookVector and the part’s LookVector. When you do this you can then write a simple script to get the CFrame of the limited thing
(check the angle on RenderStepped since that is after the camera normally updates)
You can cap the vector then, (You might be able to get it by lerping directional CFrames by an alpha calculated by (TargetAngle / Dotproduct) )
Could you provide a basic code example of this, I am still trying to warp my head around it, and there is a few variables that are undefined in your explanation (a great explanation), eg you say “to get the CFrame of the limited thing”, I am not sure what thing is, and how to actually limit that camera (and how to calculate the cap etc)
late reply but how does one do that cause I have found no dev forum post about it and the ones I posted didn’t get seen. please help.
Edit: And how did he even do that?