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

Replacing object with dead ragdoll (need to keep color)

$
0
0
Ok I just can't really come up with a simple concept here on how to handle this... but heres what I have going on. my AI is randomly generated with a color, the legs and chest (shirt and pants) are the only thing that get a color change to make them appear different from one another. I change the color using renderer.material.color (using a random range C#) My issue is, figuring out how to store the color, having the object delete (without loosing the color) and creating the ragdoll with the new color. The only solution I can see here is to make some type of death manager object that stores colors of specific objects, send a message to the manager with the color, and then grabs the color with the ragdoll I'm creating and on start change the color...? This idea seems like over kill but logically I can't really think of anything else. So to recap - I don't need help destroying or instantiating the ragdoll, the random color is a child script attached to the chest and legs of the hardbody AI, the ragdoll AI has the same chest/leg child object I just can't figure out a simple way to get the random color form that object I'm destroying, to the one I'm creating... Syntax is kind of killing me to because I'm a bit confused on passing a color (3 floats?). Any tips or advice would be nice guys. Thanks as always.

Viewing all articles
Browse latest Browse all 565

Trending Articles



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