Guest User

Freeze Frame

a guest
Jan 14th, 2018
7,824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Start your project by making a Mesh > Plane
  2. //Set the Mesh's X Rotation to 0
  3. //Using the scale tool align the edges of your mesh with the edges of the preview so that it just covers the screen
  4. //Make a new Material > Diffuse and make its Cull Mode = Front (thins makes it so the texture for the mesh faces away from the camera //rendering it invisible)
  5. //And also apply the new Material to your mesh
  6. //Create a script with the code below
  7. //Finally add a script component to your camera and add the script you just made and set it to Tapped
  8. //Connect the inputs and it should work
  9.  
  10. //@input Component.Camera camera
  11. //@input Asset.Texture deviceCameraTexture
  12. //@input Component.MeshVisual meshVisual
  13.  
  14. //Takes a screenshot which we can access with textureCopy
  15. var textureCopy = script.deviceCameraTexture.copyFrame();
  16.  
  17. //Applies textureCopy to the
  18. script.meshVisual.mainPass.baseTex = textureCopy;
  19.          
  20. //Sets the Mesh's texture to face the camera  
  21. script.meshVisual.mainPass.cullMode = 1;
Add Comment
Please, Sign In to add comment