Skip to content

Visualise a device camera feed (front or rear) as background of a Unity camera or GameObject

Notifications You must be signed in to change notification settings

2-REC/unity-camera-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAMERA VIEWER

Allows to visualise a device camera feed (front or rear) as background of a Unity camera or GameObject, useful for AR like camera view.
...

Remarks:

  • Cannot have 2 camera feeds at the same time, only the last to be instantiated is working.
    => It seems to be a bug in Unity (?)

(TODO: check...)

  • For the "Camera Canvas Viewer", when changing the resolution of the game:
    • Player
      => Choose the desired resolution:
      "Edit" -> "Project settings" -> "Player"
      (or choose from the drop down list in the "Game" window)
    • Canvas object
      => Set the same resolution as for the Player:
      "Canvas Scaler": Set the "X" and "Y" values in "Reference Resolution"
    • "Camera View" (RawImage object)
      => Follow these steps in this order:
      1. "AspectRatioFitter": Set "Aspect Ratio" to "None"
      2. "Rect Transform": Set all the size values back to 0 ("Left", "Top", "Pos Z", "Right", "Bottom")
      3. "AspectRatioFitter": Set "Aspect Ratio" back to "Envelope Parent"

About

Visualise a device camera feed (front or rear) as background of a Unity camera or GameObject

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages