Directly Controlling an .fbx MakeHuman Avatar in Unity With a Script - unity3d

I imported a character from MakeHuman into Unity as .fbx file.
Now I am trying to controll the characters parts/skeleton, e.g. the head rotation (see picture below for full skeleton structure), directly with a script, but I am pretty new to Unity. Maybe someone has any tips for me on how to acces the parts of the skeleton.
My guess is to use GetComponent() to access every component one by one, but what is their type? And is there maybe a smoother way which keeps the tree structure?

If you imported the rig of the character as humanoid and set all bones in the import tap, you could try to get those propertys out of the animator. He should now which gameobject is which bone, case you mapped it for him.

Related

What is the best way to make slight feature changes to imported unity assets?

I found a pack of unity assets (these 3D characters with built-in animations) that serves my purposes very well, but I want make slight feature changes to some of them. For example, I would want to change the color of some, maybe add a horn or other utensil, make the tail longer etc. I would like these changes to impact the animations minimally. I am wondering about what is the best workflow for this.
I looked into importing the .fbx files into Blender to make such featural changes, but the animations are not retained in Blender (this seems to inevitable according to some?). In general, most information is about workflows going from Blender to Unity, rather than the other way. I am thinking of importing the .fbx files into Blender regardless, without the animations, changing some features, and then importing back into Unity, hoping that the Unity animations can snap back onto the modified creature.
Since I am a beginner with both Unity and Blender, I wanted to check whether this is has a chance to work or whether there are better alternatives. Many thanks.
Unity animation if done using the main tool is probably just animating properties of the model/objects that are exposed to Unity's serialized interface, e.g. color, position, etc. So, either they animated the model hierarchy inside Unity (sounds unlikely), in which case the animation is part of an animation clip, or they did it in Blender, in which case the animation should be part of the fbx.
You can try an application like Fbx Review to view the fbx file and see if it includes the animation.
Unity Animation
Unity binds its animation streams with Transform/GameObject names. As long as you don't modify the hierarchy of the model, you should be able to modify it in blender like you want and later import into Unity.
Fbx Animation
Simply import into Blender, and make any changes that don't break the animations.
Alternative
If you really must, you can modify the imported mesh inside the Unity Editor. There's a few tools available for this in the assetstore.
Last Bet
Simply email the asset seller and ask them what the best way to proceed would be. For a 150$, they will probably be willing to provide this amount of support.

Can't add Orbital script - "The script needs to derive from MonoBehaviour!"

I am developing in Unity 3D for the Microsoft HoloLens 1. I am trying to add the Orbital script from the Mixed Reality Tool Kit to a GameObject, but no matter what I do I keep getting this error message:
"Can't add script behaviour ScreenSpaceMousePointer. The script needs to derive from MonoBehaviour!"
I don't understand why I'm getting this message, since I'm trying to add Orbital, not ScreenSpaceMousePointer. Is there any way to get around this?
EDIT: For further context, I am trying to affix an upright plane with a little map on it to the bottom right of the HoloLens display such that it follows the user wherever they turn their head (much like how a minimap looks in video games).
Orbital inherits from Solver which inherits from MonoBehaviour. So you should be adding it to a GameObject. It's unclear why that error message is appearing without more information.
What version of MRTK/Unity are you using?
Can you create a cube and add orbital via "AddComponent" in inspector?
Can you search for the orbital script in your assets window and drag it onto a simple cube in inspector?
Unfortunately I cannot repo your issue. You can also try looking at the SolverExamples unity scene.
Please, show this script.
Head of it must be like this:
class Orbital: MonoBehavior {
And file name must be Orbital.cs
You may create this file and put inside code you need, but rename class and file to avoid duplicate class name.
Do you have errors in your project? This usually happens for a message you got.

I can't figure out Unity / Blender / makehuman root motion

I have tried every single variation and permutation that I can think of.
I start at make human while I'm prototyping because it's fast. I then take it to Blender where I apply a bvh file.
I adjust the graph editor because the bvh files never get it quite right. Then I import into Unity.
I think the root node would be [character/master/root]. I set the root position x/y baked. I have set the rig's root to the above.
My character either jumps back at loop, which I know means wrong root node, but when he doesn't do that there is no forward movement whatsoever.
Unless I click is kinematic which removes the interaction with physics.
When iskinematic is clicked it moves like I want it to, but you know that isn't good for physics. What can I try next?
i found a solution i had not seen yet and i went back to make human and imported a new unity rig from https://forum.unity.com/threads/makehuman-and-unity.617311/
and exported to blender using the unity export...
then i exported to unity and made a humanoid animation it seems to be working better

Prefab in Unity and HoloLens falling below the spatial mapping

I'm working in a Unity application with HoloLens, where I place different prefabs across a room and I use TapToPlace to put it on a surface using SpatialMapping. I works great with some fbx models that I had, but then I received some models that I got in .max format, which I converted to FBX using 3DS Mask, they look good, but the exact setup as the other models, whenever I tap them, they are place halfway below the surface.
I've noticed that the working prefabs puts the cursor right at the bottom when in placing mode, while the "broken" ones put the cursor in the middle. Here is an example of how it looks in Unity:
Working:
Not working:
What is that circle there? it looks like the cursor, because everytime that I tap the object, the cursor is placed exactly there for each prefab, but for the ones in the center, half of the model shows below the surface, somehow it looks like it's related; is there a way to move that to the bottom as the working one looks like? if not, is there something that I need to do in 3DS max when exporting these new models to FBX? both models are using box collider, TwoHandManipulatable and TapToPlace.
Thank you, I appreciate the help.
The issue is on the axisof the model -- the pivot point of the model is not at the bottom of the model.
If at all possible it is recommended that you fix the model in your 3D modelling application, If this is not possible, you can fix it in Unity by adding an extra parent transform, more information please see:
https://answers.unity.com/questions/62675/redefine-axis-of-an-object.html
https://answers.unity.com/questions/357698/can-we-change-the-pivot-points-of-any-gameobject.html

Change animation character in mixamo fbx animation

I have a mixamo based animation with a specific character in fbx format. This animation includes some custom made objects as well, that were later added on top of the original mixamo animation. I am wondering if there is a simple way to use this fbx file to add more mixamo animations to that character and if there is a way to change the character itself to another fuse generated character, using the exact same animation as the one on the fbx file. Is there an easy way to do that without being a 3d animator ? (which i am not :) Thanks !
Import the character as humanoid in fbx settings inside unity.
You can then, retarget animations to multiple characters by using the same animation controller to multiple character having different avatar.
There's a step by step guide here. Have a look at this link:
https://docs.unity3d.com/Manual/Retargeting.html
Hope this helps.