generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Non-Player Characters - Hat and Tool Positions

Previous Thread :: Next Thread 
JC_h is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image