How can I make it so that each person being tracked to have their own mesh? For example person 1 to have a mesh / 3d model 1 following their moves and person 2 to have a mesh / 3d model 2 following their moves and so on.
And what can I do so that person 1 has always mesh 1 following his/her moves? And the same for person 2
This option is not currently available in our plugin.
Each detected person has their own ID you can track and assign a specific mesh to.
The ID only changes when the person is no longer detected and is detected back again.
Your answer is a bit confusing as you first said that the option is not available and then you told me that the persons are tracked so technically the option might seem available.
May I ask that you clarify what you meant?
Is it possible for 2 people to control 2 different meshes?
It’s not directly available in the plugin, but there is an easy way of adding it by tracking the detections’ ID. This is something you will have to do on your side.
In the ZED_BodyTracking_Visualizer script, you can get the id here :
I’ve been looking at this BP for days now trying to figure out how it works in order to implement different meshes for 2 persons.
I see that there is a block of nodes called New Detection : Spawn a new Avatar and update its Skeletal Mesh with Body Tracking Data. I am guessing that is the part that creates the 2nd (and 3rd and 4th and so on) avatar. But I have no idea how to use it. I can also see that it recalls ABP_ZED_Manny so I am guessing it should recall another ABP as that one is dedicated to the first mesh and its child. Am I right?
May I ask that you provide an example with just to players each controlling a different avatar? This is all I need.
First, you need to setup multiple avatars and add them in your project.
Then, all you need to modify is the “spawn actor” part to spawn a different actor based on the detection ID.
The easier way of doing this is changing the “Actor class” variable to an array, where you put all the different avatars you want to use and then, create a rule to choose a different avatar based on the detection ID and you’re good.
Because as you know, in order to change the avatar from ZED Manny to some other avatar, we need to go through these phases:
From Skeletal Mesh → IK Rig → Retargeter → Actor Blueprint → BP_ZED_Manny (ABP + Skeletal Mesh as child component)
which I did. So when you say that I need to prepare multiple avatars, what do you mean?
BTW, if I am to use another BP_ZED_Manny copy, for example if I duplicate BP_ZED_Manny to BP_ZED_Manny1 and use that as Actor Class, UE crashes.
And because UE crashes if I try to use any other BP instead of the BP_ZED_Manny, of course it crashes if I try to d othe following. For example I was thinking of making 2 Actor Class variables (Actor Class 0 and Actor Class 1) and put BP_ZED_Manny in Actor Class 0 and BP_ZED_Mono in Actor Class 1 like you see in the images. But whenever I use something else than BP_ZED_Manny, UE crashes.
Thank you, Benjamin! So did I understand correctly that I would have to use multiple BPs like BP_ZED_Manny? Or is this approach not feasible? As you know, there is also an ABP_ZED_Manny.
If you want to replicate the crash, just duplicate BP_ZED_Manny and you will create a new file named BP_ZED_Manny1. Drag and drop this newly created file in BP_Body_Tracking_Visualizer in ZED → Actor Class. The avatar will appear in T-pose and than UE will crash in less than a second.
Considering I really don’t know how to use arrays properly, and I only want to have 2 players at the same time (for now), I tried a different approach with the following logic:
From id, I get the player id which I go through a modulo to only get a 0 for player 1 and a 1 for player 2
I am using 2 sets of ABP_ZED_Manny (ABP_ZED_Manny and ABP_ZED_Manny2), and 2 sets of BP_ZED_Manny (BP_ZED_Manny and BP_ZED_Manny2)
Then I duplicate the New Detection : Spawn a new Avatar and update its Skeletal Mesh with Body Tracking Data
I use a Switch on int node to activate one spawn or the other
I do the same for the part where the Avatar is already in the scene, and only update its Skeletal Mesh. Meaning depending on 0 or 1 coming from id, I activate one or the other branch that technically should control one or the other avatar.
But of course it does not work But at least UE does not crash. Please let me know what I am doing wrong.
I can push an update preventing UE to crash but it’s actually expected that using a clone of BP_ZED_Manny does not work, you need to create a child actor instead.
Hi Benjamin! In the end I believe I managed to solve it for now using only 2 players. But 2 players is what I will have so it is ok from this perspective.
I duplicated the following nodes and adapted them a bit:
If the Avatar controlled by Player ID 0 is already in the scene, only update its Skeletal Mesh
If the Avatar controlled by Player ID 2 is already in the scene, only update its Skeletal Mesh
and
New Detection : Spawn a new Avatar for Player id 0 and update its Skeletal Mesh with Body Tracking Data
New Detection : Spawn a new Avatar for Player id 1 and update its Skeletal Mesh with Body Tracking Data
And I am using the same ABP_ZED_Manny, but 2 different BP_ZED_Manny BPs (BP_ZED_Manny and BP_ZED_Manny2)
And I am changing the meshes separately from inside of BP_ZED_Manny and BP_ZED_Manny2 for each of the 2 players. I made a comment on the other post on how I do that for 1 player. See here.
It would be great if you can do a BP where we can use the array in order to use multiple players without needing to multiply the nodes. DO you think you can do it?
I don’t know about the rest, but when using a ZED camera inside of UE for Body Tracking, I am pretty sure, people actually need this ability to use different meshes for different players.