Hi, I’m trying to position these enemies exactly above the black path shown in the video, However the feet of the character are a little bit under the black path which is not what I’m wanting. I want the feet and all to be exactly above the black path.
I’m using tween service to position the enemies.
I’m not using humanoids.
here is my current Y positioning method:
(Nodes[Node].Position + Vector3.new(0, model:GetExtentsSize().Y / 2, 0)).Y
Here is a video for clarification:
RafehPvP
(RafehPvP)
October 10, 2023, 3:17am
#2
Have you tried adjusting the HipHeight?
MineJulRBX
(MineJulRBX)
October 10, 2023, 3:20am
#4
I’m making a guess they are being positioned to the center of the path height, in which case adding half the height of the path should move them from the center to the top of the path.
RafehPvP
(RafehPvP)
October 10, 2023, 3:20am
#5
Ah, that totally went past me! It might have something to do with how your Npcs are Set-up. See if you can adjust the position of the meshes and re-parent them again?
No no haha. I just edited it into the post. It just wasn’t there when you looked at it. Sorry lol
The node is above the black path, Which is what the Nodes[Node].Position is. So is there way to position it directly above the node?
Here is a picture for reference:
MineJulRBX
(MineJulRBX)
October 10, 2023, 3:52am
#8
I found the result is inconsistent depending on the height of the model/character you’re positioning, haven’t figured out how to otherwise properly position them.
Katrist
(Katrist)
October 10, 2023, 3:53am
#9
Can’t you just add the difference of the size of the model?
Code:
(Nodes[Node].Position + Vector3.yAxis * model.PrimaryPart.Size.Y).Y
(Size.Y is the height of your object if it is orientated correctly, you can always change it to .X or .Z if the results are unexpected)
Result:
I changed the size of the character to better see everything
Katrist
(Katrist)
October 10, 2023, 3:59am
#11
Apologies, I forgot to add the size of the node part. I believe that was the only problem you actually had, so I’m sorry for misleading you.
Code:
(Nodes[Node].Position + Vector3.yAxis * Nodes[Node].Size.Y / 2 + Vector3.yAxis * modelmodel:GetExtentsSize().Y / 2).Y
Your fine. I appreciate you helping regardless.
Result:
If it helps here is the full positioning line, Maybe i did something wrong.
model:SetPrimaryPartCFrame(CFrame.lookAt(CFrame.new(Vector3.new(enemyInfo[1].X / 10^2, (Nodes[Node].Position + Vector3.yAxis * Nodes[Node].Size.Y / 2 + Vector3.yAxis * model.PrimaryPart.Size.Y).Y, enemyInfo[1].Y / 10^2)).Position, Vector3.new(Nodes[Node + 1].Position.X, model.PrimaryPart.CFrame.Y, Nodes[Node + 1].Position.Z)))
Katrist
(Katrist)
October 10, 2023, 4:08am
#13
Could you try this?
Code:
model:SetPrimaryPartCFrame(CFrame.lookAt(
Vector3.new(
enemyInfo[1].X / 10^2,
(Nodes[Node].Position + Vector3.yAxis * Nodes[Node].Size.Y / 2 + Vector3.yAxis * model:GetExtentsSize().Y / 2).Y,
enemyInfo[1].Y / 10^2
),
Vector3.new(Nodes[Node + 1].Position.X,
model.PrimaryPart.CFrame.Y,
Nodes[Node + 1].Position.Z
)
)
)
Apologies for the weird indentation, just did it so I can read it better.
Removed the animation so it was better to see.
Result:
I finally fixed it.
Simply:
model.PrimaryPart.Size.Y / 2 * 0.5
system
(system)
Closed
October 24, 2023, 4:30pm
#17
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.