How to have actions undone when Raycast leaves object?

I’m making a VR game and I have certain objects in the game that you can look at and press a button to be able to grab them with your face and move them around. Right now I have it set so that when the ray from the camera connects with the object I’m picking up, it scales up by 1.5. I want it to return to normal when the ray leaves the object but I have no idea how to do that. Any ideas? Is it even possible? I’m new to all of this and especially to raycasting.

Generally you will need to poll every frame to see if the object should reset. Think about the logic as if you are scaling the object to 1.0 unless it is hit by a raycast this frame.

Ah, I think I get it. Thanks!

EDIT: Yup. Worked Great!