Confusing errors?

This is like my second question in like two weeks. Don’t want to be a person who continually ask questions about code but this confusing to me. I’m not the brightest when it comes to C# script code but this is weird none the less. Firstly, here’s the code I’ve written out:

public class IceSword : MonoBehaviour {


	// Update is called once per frame
	void Update () {
		if(Input.GetKeyDown(KeyCode.LeftShift)(KeyCode.RightShift))
			// have IceSword Appear at Clark Eagleheart right hand  
	}
}

In my opinion, there should be an error at 10 but there isn’t. Instead there is a error cs1525 at (11,9) and a error cs8025 at (12,1). The weird thing is that I am trying my best to follow within the braces as the code suggests I do but the code I’m writing is making it frustrating and I’m close to a headache. I would appreciate it if someone could shed some light on what I am doing wrong. Thank you.

If I get this right, you’re trying to check if the player is holding left shift OR right shift? If so, you’ll need a separate GetKeyDown call for each button you’d like to check.

Something like this:

if (Input.GetKeyDown(KeyCode.LeftShift) || Input.GetKeyDown(KeyCode.RightShift)) {
    //do stuff
}

Notice the || operator, which is a logical OR. There’s also &&, which is logical AND. Any time you want to check multiple conditions, you might end up using those.

If that’s new to you, you might want to look up some tutorials about “if” statements, boolean operators, boolean logic, and that sort of stuff.

Also, don’t worry about asking too many questions! :slight_smile: That’s what we’re here for.