build different than editor: raycast does not work.

Hi there, excuse my english…
So evrything is working well, no warnings no errors but the build is not behaving the player as it should. the raycast for the ground is not working!!
So it looks like the speed of the build is linking my rays …
so i have no idea at all…

that is the code for the raycast to ask ( am i in the air?):

public function LateUpdate() : void {
	//Checking Jumping by using Raycast
	var hit : RaycastHit;
	var v3_hit : Vector3 = transform.TransformDirection (-Vector3.up) * (f_height * 0.5);
	var v3_right : Vector3 = new Vector3(transform.position.x + (collider.bounds.size.x*0.45), transform.position.y, transform.position.z);
	var v3_left : Vector3 = new Vector3(transform.position.x - (collider.bounds.size.x*0.45), transform.position.y, transform.position.z);

    if (Physics.Raycast (transform.position, v3_hit, hit, 2.5, layerMask.value)) {
        b_isJumping = false;
    } else if (Physics.Raycast (v3_right, v3_hit, hit, 2.5, layerMask.value)) {
   		if (b_isJumping) {
        	b_isJumping = false;
        }
    } else if (Physics.Raycast (v3_left, v3_hit, hit, 2.5, layerMask.value)) {
        if (b_isJumping) {
        	b_isJumping = false;
        }
    } else {
		if (!b_isJumping) {
	    	if (Mathf.Floor(transform.position.y) == f_lastY) {
	    		b_isJumping = false;
	    	} else {
	    		b_isJumping = true;
	    	}
	    }
	}
    f_lastY = Mathf.Floor(transform.position.y);

but it must not be the problem…
can some one light me with that?
thank you very much.
here you can find the all project if you have the bravery (the scene is “simple_platform”…

https://www.wetransfer.com/downloads/6d08b595f53bdf8beece23671f2fed2220130508141350/f7f638ee058eef964614ed03ffbe0e4c20130508141350/67bdbb

erratum…

sory i pased the wrong code for the ray cast(another obj)… it is almost the same one with the problem is:

public function LateUpdate():void{


   var hit : RaycastHit;
	var v3_hit : Vector3 = transform.TransformDirection (-Vector3.up) * (f_height * 0.5);
	var v3_right : Vector3 = new Vector3(transform.position.x + (collider.bounds.size.x*0.45), transform.position.y, transform.position.z);
	var v3_left : Vector3 = new Vector3(transform.position.x - (collider.bounds.size.x*0.45), transform.position.y, transform.position.z);

	if (Physics.Raycast (transform.position, v3_hit, hit, 2.5, layerMask.value) || 
	Physics.Raycast (v3_right, v3_hit, hit, 2.5, layerMask.value)||
	Physics.Raycast (v3_left, v3_hit, hit, 2.5, layerMask.value))
	
	{airy=false;}
//--------------------------------------------------SWEET PHYSIQUE---------------------------------------------------------------	
	else {
		if (!airy) {
	    	if (Mathf.Floor(transform.position.y) == f_lastY) {
	    		airy = false;
	    	} else {
	    		airy = true;
	    		
	    	}
	    }
	}
	
	f_lastY = Mathf.Floor(transform.position.y);

I’ve actually been running into a similar issue more than once. I’m using raycasts to determine new GameObject positions in my scene. It works perfectly in the editor, but not in the standalone build.

On my first build, I discovered that the issue was this:
My scene contained a Root object that had a Rigidbody component.
As a child of the Root object was the Player object, which also had a Rigibody component.
As a child of the Player object was my Main Camera.

It turns out that having a Rigidbody on a child of another Rigidbody is a big Don’t Do That. The reasons why are not hard to find out there. I removed the Rigidbody from my Player object and then it worked.

Now I’ve built a bit more and the same issue has come up again for my second build. Obviously I’m not repeating my previous problem. Still the raycast source + direction are different in the build version compare to the editor. (So different, in fact that the whole game doesn’t work.)

If anyone has any insights on what could go wrong, please let me know.
If/when I learn more about this problem, I’ll be sure to share!