Hi guys, I want to recreate starscapes mouse collisions for ships but I cannot figure out how. I have tried using GuiCollision by Jaipack17 but the mouse clips to the other side of the frame when I try to. How can I recreate star scapes?
Could you explain more what you want to create?
I’m not familiar with Starscape.
I still don’t know what you want to recreate…
A hold & drop? A line following the mouse?
How should it work?
Then, you should check the mouse delta (distance between previous and current position), and depending on its magnitude from screen center point, move the cursor.
https://developer.roblox.com/en-us/api-reference/property/InputObject/Delta
local delta = UIS.Delta
newMousePos = Vector2.new(delta.X, delta.Y) / (1 + centerPointMagnitude * .01)
^ an example of how should it look like more or less CV
local vpsize = workspace.CurrentCamera.ViewportSize
local screenCenter = Vector2.new(vpsize.X / 2, vpsize.Y / 2)
local centerPointMagnitude = (screenCenter - Vector2.new(Mouse.X, Mouse.Y)).Magnitude
The higher centerPointMagnitude
, the higher the divisor is, so the mouse will move less.
The formula is not perfect though, I used 0.01 as a random value and the whole formula is linear. You probably need to adjust it or replace it with something more advanced, like an exponential formula.