Hello! I'm making a survival game. In the first level, you are put in a crib as a child, and a feature I'm trying to add is if the players camera is pointing at a certain part, it will make the player become closer to the part, or standing up, rather. I've heard people ask similar questions, but the only answer I can get out of them is if the part is visible, and I'm looking for this part to be invisible
. The only problem being is I have no idea where to start, because I've never had experience with something like this.
Although, if someone could get me a working answer, I can implement that into my brain and type it out next time. Thanks!
use an if statement for Mouse.Target. You can get the players mouse by using the following script:
local player = game.Players.LocalPlayer local mouse = player:GetMouse() mouse.Move:Connect(function() --code. end)