Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

"WARNING: Boolean expression will always have the same value."

$
0
0
Hello! I am trying to make it to where my gun won't fire until the reload animation is finished, but I'm having some trouble. I don't see what is wrong with `{if (!gameObject.transform.parent.transform.FindChild("Gun").GetComponent.().isPlaying)` , but hopefully, you could help me fix it! In another script that's actually attached to the gun itself, `{if (!GetComponent.().isPlaying)` works fine. var DamageAmount : int = 34; var TargetDistance : float; var AllowedRange : float = 75; function Update() {if (!gameObject.transform.parent.transform.FindChild("Gun").GetComponent.().isPlaying) { {if(Input.GetButtonDown("Attack")) {var Shot : RaycastHit; if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), Shot)) {TargetDistance = Shot.distance; if (TargetDistance < AllowedRange) {Shot.transform.SendMessage("DeductPoints", DamageAmount);}}}}}}

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>