Quantcast
Channel: Questions in topic: "ragdoll"
Viewing all articles
Browse latest Browse all 565

how do enable two box colliders on the same gameobject throught script?

$
0
0
i have a script which makes my enemy ragdoll when shot. `if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range)) { RagdollController ragdoll = hit.transform.GetComponent(); if (ragdoll != null) { ragdoll.die(); }` this works fine however due to this line of code ` setColliderState(false);` which turns off all of the colliders when i shoot the enemy it does nothing. i tried to fix this by using `boxcollider.enabled = true;` but since i have two box colliders which i need to be on, it only turned on the first one. so i would like to know if there is a way to enable both of them or change one of their names. please and thank you.

Viewing all articles
Browse latest Browse all 565

Trending Articles



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