Freeze object's position and rotation

Being more specific, i want to know how can i make an object (more specifically an statue model) freeze at it’s current position and rotation when seen. I’m making an small project which is heavily based on the weeping angels and a little bit on slender (But it isn’t the typical “Hurr durr get tah noutes bifor slender kills yah”) and i need to have a script which freeze the angel (in it’s actual animation, if possible) when the player sees it and unfreezes it when it’s out of the camera’s view.

Extra: Also I’m thinking about adding a “blinking system” as i like to call it, in which your character needs to blink every X seconds (Like in SCP containment breach) but from all the scripts i wrote, every single one of them failed.

you can use the isVisible property of any renderer to check whether it is in view of the camera.

Unity - Scripting API: Renderer.isVisible.

StatueScript statue;

    if (statue.gameObject.renderer.isVisible)

Hallo :slight_smile:

Well you can make an Emtygameobject and add a square Collider to it … its and invisible collider.

And then you can make a script with IF statements like

function OnTriggerEnter (other : Collider)
   // Check for collsion 
   if(other.gameObject.tag == "Gametagofyourobject")
 	 Debug.Log("you did just collide and need to freese");


And then in the if statement …

you can look in the unity API after the transform class and see your options and then make a math.clamp … i am sure you can figure something out that way

Hope this helps just a little