Switch between animations

Hello,

I have a ton of animations imported from cinema 4d and its about a little fish on a fish floor swimming. with see weed and some other stuff… i also have the same scene but then everything is dead… fish is fishbone swimming, sea weed hangs but still waves with the water. (water is not visible btw, just the motion)

i have this lardy working with playmaker but i want to recreate this without plugins.
the idea is that when you push a button that the the whole scene switches from alive scene to dead scene…
so both scenes need to play constant and at the same time…
the fish for instance swims a certain path and when you switch the dead fish needs to be in the exact same place where the alive fish ended and vice versa.

so to makes things a little more easier.
i have one alive see aeed waving
and one dead sea weed waving.
there at one another in the scene and when i hit play they both begin waving and going the same way.
my question now is. how can i switch between them?
do i need to script the alpha? or something else?

In playmaker i could set the alpha, but even when the alpha was 0 the animation still plays, you only can’t see it playing. but i don’t want to use plugins.

hope you guys can help,
Thnx in advance!!!

Nick

If I understand this correctly, this is not really an animation question. This is really a rendering question. Now, I’m not a coder, but there are ways to turn off the rendering of meshes, and I’m pretty sure you can do this with code. Even in the side panel, when you select an object in the scene, there is a check box in the Mesh Renders. If you uncheck that, you won’t see the mesh anymore. So, you could just toggle each mesh render on and off.

Hi medhue, thank you for your reply, i knew the mesh renderer check box, for me its called skinned mesh renderer,
probably because i made an animation with bones controlling the mesh. but anyway, i need to set that or some other way to a button so i can switch it with the push of a button :slight_smile:

So I’ve been working on some characters that have there loadouts (clothing/armor/hair) switched our in code. Similar to medhue I don’t deal with the code side but I have created several clothing pieces and the coder turns on/off the pieces at run time when the item is selected for a character.
I’ve also read somewhere (can’t remember) that this process can also be controlled by alpha masking in the texture/material.
With the two options I mentioned everything is in the same scene and visibility is controlled via code.

thank you for your reply but i still don’t understand how to set this up in unity. how do you switch between objects?

It is more “formal” and “technical” to change each MeshRenderer & SkinnedMeshRenderer 's mesh,

but if you just want to get things done fast, the simplest method is to place the “dead scene” 100 units below the “alive scene”, and move the camera position when you do the switch.

And you need to set all the animation/animator component’s culling mode to “Always animate”.

1 Like

or possibly, have 2 cameras, and switch between them.

will try these options. thnx guys!!