Trigger problem

Hello guys, I’ve got a problem with trigger, here it’s code :
using UnityEngine;
using System.Collections;

public class Trigger : MonoBehaviour {

	public AudioClip watersound;
	private bool InWater;

	// Use this for initialization
	void Start () {

	}
	
	// Update is called once per frame
	void Update () {
		
	}

	public void OnTriggerEnter(Collider other){
		if(other.tag == "Water" && Camera.main.audio.isPlaying != true)
		{
			Camera.main.audio.clip = watersound;
			Camera.main.audio.Play();
			PlayerScript.Pspeed = 0.007f;
			InWater = true;
		}
		else if(other.tag == "Ground" && Camera.main.audio.isPlaying != true)
		{
			InWater = false;
			PlayerScript.Pspeed = 0.016f;
		}
	}
}

the trigger should make player speed slower when it touch the blue square, but it doesn’t do that, I can say better, it’s do nothing =/, here’re some screens :

and another screen, all squares have got a rigidbody attached

It could be because this line is evaluating to ‘false’:

if(other.tag == "Water" && Camera.main.audio.isPlaying != true)

Change that to:

if(other.tag == "Water")

And see if it works now. I’m not sure what purpose you are evaluating the sound playing, but I think this is your key. That is, unless it in your player movement code.

oh, Nanobrain, your idea don’t works, trigger still doesn’t make anything =\