To change the part position, use the offset in this line of the code: FollowPart.Position = + Vector3. How do i position an attachment WhatDidHeDo title says a lot about this post, how do I position an attachment I tried this: if typeof (position) 'Vector3' then attach.Position attach.Position + position print ('moved') end even that didn’t work, even though it printed ‘moved’. The parameter needs to contain the player Instance(ex: ) If you use the function separately, don't forget to put the player parameter. Place this code in a script(not a local script). Players.PlayerAdded:Connect(OnPlayerAdded) connect's the weld to the player's head and the other part Local WeldConstraint = Instance.new('WeldConstraint') set's the part position on top of the player's head, with an offsetįollowPart.Position = + Vector3.new(0,2,0) Local FollowPart = FollowPartOriginal:Clone() don't delete the line below, if you want only 1 part, delete the line below. If you want to clone the part, so more players can be followed by it, Local FollowPartOriginal = workspace:WaitForChild('Part') Write the path to the part you want to follow the player, bellow Local PlayerHead = PlayerModel:WaitForChild('Head') Get's the player's head inside it's model Local PlayerModel = workspace:WaitForChild(PlayerCharacter.Name) waits until the player's character loads Here is an example code that adds a part at the top of a player's head when it joins the game: local Players = game:GetService('Players') - get's the players service Here is a link for the API reference about the subject: The parts are going to stay at the same relative position from each other. You can create it by code and connect 2 parts to it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |