JC_h
|
  |
| Joined: 06 May 2016 |
| Total Posts: 9 |
|
|
| 09 May 2016 09:33 PM |
Hello!
I am currently working on a game and have come across the following problem:
When creating Player Characters, inserting 1) A hat will cause the hat to pop on their head. 2) A tool will cause the player's arm to come out and equip the weapon.
However, in both cases, attempting to apply this to a Non-Player Character will simply place the object into the workspace.
As an example, something like game.ReplicatedStorage.WhiteBeanieWithHair:clone().Parent = workspace.Player1 will place it correctly, but game.ReplicatedStorage.WhiteBeanieWithHair:clone().Parent = workspace.NPC1 does not
Is there an easy way to get this snapping to happenw ith NPCs, or should I manually use CFrame to try and find a suitable position for each individual hat and tool, as well as properly rotating the arm in the latter's case? |
|
|
| Report Abuse |
|
|
dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
|
| 09 May 2016 09:35 PM |
make sure the hats a hat and tools a tool, make sure the NPC has appropriate motor6ds and a torso and a head and it should work
|
|
|
| Report Abuse |
|
|
JC_h
|
  |
| Joined: 06 May 2016 |
| Total Posts: 9 |
|
|
| 09 May 2016 09:52 PM |
I have made the following changes to my NPC: Added Motor6Ds copied and pasted from an instance of Player1 with the names of Left Hip, Left Shoulder, Neck, Right Hip, Right Shoulder into the humanoid.
Added a clone of the torso called HumanoidRootPart Added a RootJoint Motor6D into the HumanoidRootPart
These changes did not appear to fix the problem. The problem also persists when the HumanoidRootPart is removed and the RootJoint is instead located inside of the Torso.
Is there a Motor6D I neglected to add in? If not, are there any other things that need to be added? If nothing seems apparent, could you provide an NPC model with which you have been able to freely add hair onto? |
|
|
| Report Abuse |
|
|
dave2011
|
  |
| Joined: 02 Oct 2010 |
| Total Posts: 10581 |
|
|
| 09 May 2016 11:07 PM |
you have to set part0 and part1 correctly
|
|
|
| Report Abuse |
|
|
JC_h
|
  |
| Joined: 06 May 2016 |
| Total Posts: 9 |
|
|
| 10 May 2016 03:00 PM |
| Thank you for your help. I didn't notice that cloning the Motor6D would not carry over the names for Part0 and Part1. I also learned that the humanoid's parts cannot be anchored. These changes allowed for the Hat to be properly equipped. |
|
|
| Report Abuse |
|
|