Hi, I am trying to make a menu script for a game I am working on. How do I make something like this?
Basically how do I make a script where the players view follows the cursor?
Hi, I am trying to make a menu script for a game I am working on. How do I make something like this?
Basically how do I make a script where the players view follows the cursor?
You’d have to lerp or tween the camera’s cframe or whatever you want to change to the mouse position. A good way to start would be creating a localscript to find the player mouse and camera, then connect a mouse movement event to the camera view function.
You’d also need to define the delta / rate of change for the mouse, which you can do this by using the slope formula:
Y₂ - Y₁ / X₂ - X₁
Then you’d want to compare the zero position of the mouse by defining the current position as a variable, so that you can compare the change to the original position. This is because you’d need to ensure that
the rate of change for the camera stays consistent. Based on that information, you’d have to use TweenService to pan the camera to the new position.
Hope this helps a bit.