ive seen this effect a lot recently and im wondering how i would recreate this in roblox
Looks like a 3d object with a decal that just like points at the mouse on the X and Y axis.
Dont think theres much more to it. They might have also put it into a viewport frame, but that’d be kinda hard to tell if they did.
yea i was thinking about that, but this is on another website so thats why i was kinda thinking hard about how i could recreate it
You can use viewport frames and the position of the mouse relative to the center of the frame to rotate the part in the viewport frame accordingly.
To get the center of a frame do:
Frame.AbsolutePosition+Frame.AbsoluteSize/2
this actually worked great tysm
i made this script from it, idk if theres a easier way but this definitely works
local Frame = script.Parent.Frame.Image
local CenterOfViewport = Frame.AbsolutePosition+Frame.AbsoluteSize/2
game:GetService("RunService").RenderStepped:Connect(function()
local Mouse = game:GetService("Players").LocalPlayer:GetMouse()
local DistanceBetweenMiddleAndMouse = CenterOfViewport-Vector2.new(Mouse.X, Mouse.Y)
DistanceBetweenMiddleAndMouse /= 800
Frame.WorldModel.ImagePart.CFrame = CFrame.Angles(-DistanceBetweenMiddleAndMouse.Y, -DistanceBetweenMiddleAndMouse.X, 0)
end)
If so, please mark the post as the solution to let others know!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.