Itween, Help meh

so I been programming in c# and looked into itween because of the obvious reasons. However, when I use itween in my scripts i get an error, even when copying code from the official site. When typing in code i still get the help block to pop up but every code i enter is always underlined with a red scwiggly. I even put the file in it’s own folder under “plugins”.

Need error reports and or pictures.

I get this with any kind of itween code.

Assets/_Scripts/EnemyScript.cs(139,60): error CS1525: Unexpected symbol `{'

Looks like you are not closing out a function properly.
Can you post that chunk? That function. My bet is you are missing a bracket. Simple syntax. Email the code if you want.

the bracket is part of the itween hash. But heres the code. 6th line from the bottom.

	#region ---Attack Script---
	public void enemyAttack(int atks)
	{
		attackTimer += atks;
		
		if (attackTimer < 0) //If attacks speed is below 0 then set it to 0.
			attackTimer = 0;
		if (attackTimer > 0)
			attackTimer -= Time.deltaTime; //Syncs time with games framerate.
		
		if (_EatkDistance < maxDistance) //This will check to see if the attack distance is
			_EatkDistance = maxDistance; // greater then the distance the mob can actually
										 // walk upto the player.
		
		if (attackTimer == 0)
		{
			attackNow();
			attackTimer = attackSpeed;			
		}
	}
	
	private void attackNow()
	{
		//This will determine wheather the target is in front of the enemy.
		float distance = Vector3.Distance(target.transform.position, transform.position);
		
			Vector3 dir = (target.transform.position - transform.position).normalized;
			float direction = Vector3.Dot(dir, transform.forward);

			if (distance < _EatkDistance) {
			if (direction > 0) {
				
				//Damage calculater: Eattack * 4 - Pdefense * 2
				PlayerHealth eh = (PlayerHealth)target.GetComponent("PlayerHealth");
				_damageDealt = ((_Eattack * 4) - (eh._Pdefense * 2));
			
				if (_damageDealt < 0) //If damage is 0 or less then deal 1 damage.
				{
					_damageDealt = 1;
				}
				
				audio.Play();
				iTween.RotateTo(gameObject,{"x" : 45, "loopType" : "pingPong"});
				eh.adjustCurHealth( - _damageDealt);
			}
		}
	}
	#endregion

Well i program in js, but should it not be a regular bracket? ( )

I tried that and [ ] but still get errors doing it either way. The itween code isn’t really necessary there but I may find use for it later. The thing is I can’t get any itween code to work for c#. Is there really any difference in integrating it into c# then java?

Ok, so I tried it in java and can get itween to work in it so is there a way to use it in c#?

No i mean these tpes of brackets … ( ) like i posted above.

I understand what you was trying to say. The correct way to right it in c# is:

iTween.RotateTo(gameObject, iTween.Hash("x", 45));

Only problem with this is that the capsule i’m using as an enemy goes through the ground when it rotates then comes back up. This is because of it moves and rotates at same times. In which case doesn’t seem to be a hard fix. Thanks for your time but I think I can manage for the time being. I just didn’t quite understand itween.