Typescript camera

Does anyone know how to use an if-else statement in typescript? I need the if-else statement to detect if I’m using Camera 1. I am a complete beginner at typescript so I need all of the information I need!! I am making a wall climb script by attaching a camera to an object and then moving the object when I use the arrow keys so It moves the camera. I need an answer ASAP

Thanks!

1 Like

@Jackson_Surline Hi jackson, I’d recommend making a variable that you change alongside the camera, then checking the state of that variable in an if else statement, this can be done both in typscript or using coblocks. So if we made a variable activeCam, and set it to 1 when we change to that camera we can write in typescript:

if (activeCam = 1)
{
Insert code here;
}
else
{
Insert code here;
}

1 Like

It worked! Thanks! :slight_smile:

1 Like