- Home /
Cinemachine 2D move camera down on Button press
Hey im Currently making a 2D game kind of like spelunky at the moment ther are a lot of leaps of faith which i want to avoid by letting the player move the camera down when hitting S for an amount of time. I found theCinemachine Camera Offset extension which can be added by going on the camera and clicking extension on the bottom. here i can type in a Y offset which is what i want but i dont know how to tell it what to do in code. Any ideas on that or should i use some other methode?
public class playermovement : $$anonymous$$onoBehaviour { public CinemachineCameraOffset Offset;
if (crouch == true && Input.GetButton("Crouch"))
{
Offset.m_Offset = new Vector3(0, -3, 0);
}else
{
Offset.m_Offset = new Vector3(0, 0, 0);
}
}
Ok with unity guiding me while typing radom things into my script it seems that this is working but the camera movement is very snapy any way to make it more smoth?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to display a video behind gui on mobile 2 Answers