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: Object does not move how it should

Previous Thread :: Next Thread 
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
10 Nov 2015 08:02 AM
This part is not cancollide, and the player should be able to walk through it. I want the object to move into the players torso almost, and be in that position, but instead when it moves it automatically goes ontop the player. How can I fix this?


bin.Selected:connect(function(Mouse)
Mouse.Button1Down:connect(function()

Eff2:MoveTo(Vector3.new(5,1,0)+game.Players.LocalPlayer.Character.Head.Position)

end
end)
end)
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
10 Nov 2015 08:07 AM
CFrame it or use a BodyMover
Report Abuse
Ben1925 is not online. Ben1925
Joined: 07 Apr 2011
Total Posts: 741
10 Nov 2015 08:07 AM
Try using CFrame instead of Vector3.
Report Abuse
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
10 Nov 2015 08:10 AM
I tried;
Eff1:MoveTo(CFrame.new(5,1,0)+game.Players.LocalPlayer.Character.Head.Position)

but it errored "Eff1:MoveTo(CFrame.new(5,1,0)+game.Players.LocalPlayer.Character.Head.Position)"

I should have mentioned this was a model i'm trying to move properly.
Report Abuse
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
10 Nov 2015 08:11 AM
Error is;
Unable to cast CoordinateFrame to Vector3
Report Abuse
Ben1925 is not online. Ben1925
Joined: 07 Apr 2011
Total Posts: 741
10 Nov 2015 08:14 AM
Oh! Yes, you can't CFrame models directly, but you can CFrame their primary part.
Set a primary part in a model by

game.Workspace.Model.PrimaryPart = game.Workspace.Model.PartYouWantToSetAsPrimary

Then, do

game.Workspace.Model:SetPrimaryPartCFrame(CFrame.new(Vector3.new(x,x,x))

All other parts in the model will also be moved and will maintain their orientation and offset respective to the Primary part. This should work. If it doesn't, or if i missed something, please let me know!
Report Abuse
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
10 Nov 2015 08:19 AM
@Ben

Thank you so much!!111
Report Abuse
Ben1925 is not online. Ben1925
Joined: 07 Apr 2011
Total Posts: 741
10 Nov 2015 08:24 AM
You're welcome! It's great to know I helped someone :D
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