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: How to make a floating part stay in place above one's head?

Previous Thread :: Next Thread 
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
13 May 2016 04:35 PM
https://gyazo.com/52eea84d5d26a9f6dc798f382f746206

See how it 'lags'


Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
13 May 2016 04:39 PM
Welding
Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
13 May 2016 04:44 PM
But then the player spins with it


Report Abuse
Zarkonan_Zenheart is not online. Zarkonan_Zenheart
Joined: 29 May 2012
Total Posts: 610
13 May 2016 04:46 PM
BodyPosition

set it to player's torso + vector3.new(0,5,0) or something


Report Abuse
ray_1 is not online. ray_1
Joined: 18 Feb 2011
Total Posts: 464
13 May 2016 04:47 PM
make sure the part0 is the head and the part1 is the object
c0=CFrame.new(0,5,0) or something


Recommended username: RoundRay_1


Report Abuse
KeiRoMultiverse is not online. KeiRoMultiverse
Joined: 16 Aug 2013
Total Posts: 1896
13 May 2016 04:52 PM
You can make it connected to RenderStepped event, it won't 'lag.'
Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
13 May 2016 04:54 PM
How Kei?


Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
13 May 2016 05:07 PM
"But then the player spins with it"
You mean it spins with the player?
If so then is that not what you want?
Report Abuse
cgjnm is not online. cgjnm
Joined: 22 Dec 2011
Total Posts: 2347
13 May 2016 05:08 PM
head.Changed:connect(function()
part.CFrame = head.CFrame+CFrame.new(0,5,0)
end)
Report Abuse
zaniac10 is not online. zaniac10
Joined: 18 Aug 2009
Total Posts: 10000
13 May 2016 05:25 PM
you did welding wrong. if you don't anchor the part before welding it and then unanchoring it, it will glitch out

part_to_weld.Anchored = true
part_to_weld.CFrame = char.Head.CFrame + Vector3.new(0, 2, 0)
local weld = Instance.new("Weld",part_to_weld)
weld.Part0 = char.Head
weld.Part1 = part_to_weld
weld.C0 = char.Head.CFrame:inverse()
weld.C1 = part_to_weld.CFrame:inverse()
part_to_weld.Anchored = false


Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
13 May 2016 06:30 PM
https://gyazo.com/8eddf2cda8fa3240d202d7e0f7e55c81

The player spins and glitches

char = script.Parent.Parent.Parent.Character
part_to_weld = script.Parent
while wait() do
part_to_weld.Anchored = true
part_to_weld.CFrame = char.Head.CFrame + Vector3.new(0, 2, 0)
local weld = Instance.new("Weld",part_to_weld)
weld.Part0 = char.Head
weld.Part1 = part_to_weld
weld.C0 = char.Head.CFrame:inverse()
weld.C1 = part_to_weld.CFrame:inverse()
part_to_weld.Anchored = false
part_to_weld.Parent = char.Head
break
end



Report Abuse
zaniac10 is not online. zaniac10
Joined: 18 Aug 2009
Total Posts: 10000
13 May 2016 06:31 PM
char = script.Parent.Parent.Parent.Character
part_to_weld = script.Parent
part_to_weld.Anchored = true
part_to_weld.CFrame = char.Head.CFrame + Vector3.new(0, 2, 0)
local weld = Instance.new("Weld",part_to_weld)
weld.Part0 = char.Head
weld.Part1 = part_to_weld
weld.C0 = char.Head.CFrame:inverse()
weld.C1 = part_to_weld.CFrame:inverse()
part_to_weld.Anchored = false
part_to_weld.Parent = char.Head


Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
13 May 2016 06:37 PM
Zan, that changes nothing, I want just the cog to spin, not the whole player


Report Abuse
yourchoice1 is not online. yourchoice1
Joined: 21 Jun 2013
Total Posts: 91
13 May 2016 06:42 PM
CFrame the part right above the players head and constantly update the CFrame.
Report Abuse
Bernkastel2727 is not online. Bernkastel2727
Joined: 23 Sep 2012
Total Posts: 2612
13 May 2016 07:13 PM
Dude that's what I did but it lags, I want it to steadily be above the head


Report Abuse
sparker22 is not online. sparker22
Joined: 11 Mar 2010
Total Posts: 846
13 May 2016 07:20 PM
How does it lag? Do you mean it just isn't a smooth transition? If so then that means its not being updated frequently enough. Don't use a loop as that only executes 1/30th of a second. Use heartbeat. (Staff discourages renderstepped)
Report Abuse
cgjnm is not online. cgjnm
Joined: 22 Dec 2011
Total Posts: 2347
14 May 2016 04:14 PM
Or use my method...
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