#I hope u know how to do what ima bouta ask
1 messages · Page 1 of 1 (latest)
well you are not really showing enough to even know what that is. what component
https://docs.unity3d.com/Packages/com.unity.cinemachine@3.0/api/Cinemachine.CinemachineMixingCamera.html#methods
docs say it has get and set weight methods
finally
thankyou
someone linked me a usefull doc
now how can i make the weight of cam1 go down while cam2 goes up according to my zoom
well that is just math to do that
just work within the 0 to 1 range
if give one a weight of 0.8f well the other is going to be 1f - 0.8f
ok wait thankyou
im having trouble
understanding how to set weight
what do i do with this
its a method you call on the CinemachineMixingCamera
mxingCamera.SetWeight(vcam1Reference, newWeight)
or via index
mxingCamera.SetWeight(0, newWeight)
when the docs is showing you
public void SetWeight(CinemachineVirtualCameraBase vcam, float w)
that is just the signature of it, so you know what it returns and what types it takes as arguments
well means nothing without see the code that caused the error, but think you need to learn the basics of how to get and work with components
using UnityEngine;
using Cinemachine;
public class CameraMerge : MonoBehaviour
{
public float newWeight = 1f;
public Component mxingCamera;
public void SetWeight(CinemachineVirtualCameraBase vcam, float w)
{
}
void Update()
{
mxingCamera = GetComponent<CinemachineMixingCamera>();
mxingCamera.SetWeight(0, newWeight);
}
}
and what type is mixingCamera supposed to be, and what type did you store it in?
dont guess think about it
CinemachineMixingCamera
this
i got it
ohhh it works lets go
but now how do i set the weight for vcam2
same way you did for 1
creating another void for vcam2?