Billboard for a separate camera.
-
Or even a way to make an animated sprite for just the front camera? Something along those lines.
Comment actions -
Hi there, yep there is! Created a simple script for this. Add a new empty object to your scene. Then, add this script to it. Then, in the inspector panel, you can add objects to this script. It will manage all objects that you want enabled on the front camera only and the back camera only. Note, make sure not the add this script to the objects you'll be disabling (because disabling the object will ultimately disable the script logic).
Here's the script, called "ShowOnlyOnCamera"
// @input SceneObject[] showOnlyOnFront
// @input SceneObject[] showOnlyOnBack
// -----JS CODE-----
function onFrontCamEvent(eventData)
{
for( var i = 0; i < script.showOnlyOnFront.length; i++ ){
script.showOnlyOnFront[i].enabled = true;
}
for( var i = 0; i < script.showOnlyOnBack.length; i++ ){
script.showOnlyOnBack[i].enabled = false;
}
}
var cameraFrontEvent = script.createEvent("CameraFrontEvent");
cameraFrontEvent.bind(onFrontCamEvent);
function onBackCamEvent(eventData)
{
for( var i = 0; i < script.showOnlyOnFront.length; i++ ){
script.showOnlyOnFront[i].enabled = false;
}
for( var i = 0; i < script.showOnlyOnBack.length; i++ ){
script.showOnlyOnBack[i].enabled = true;
}
}
var cameraBackEvent = script.createEvent("CameraBackEvent");
cameraBackEvent.bind(onBackCamEvent);And a picture of what it should look like in your inspector.
Comment actions -
Works flawlessly, thanks!
Comment actions -
Worked great for me too. Thanks! Quick and easy.
Comment actions
Please sign in to leave a comment.
Have a comment?