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 » Scripting Helpers
Home Search
 

Re: Position help?

Previous Thread :: Next Thread 
sonofjupiter is not online. sonofjupiter
Joined: 12 Nov 2010
Total Posts: 251
26 Aug 2013 04:35 PM
Hey guys,

I am making a game, and I have a few bricks that are inside eachother (The collision check thing) and I made a script where it changes the position of it by one stud, but when it does, it moves it up above the brick it is in. How do I avoid this? Here is the script

while true do
    wait(.00001)
    script.Parent.Position = Vector3.new (-164.7, 347.99, 171.3)
    wait (.5)
    script.Parent.Position = Vector3.new (-164.7, 345.99, 171.3)
    wait (.5)
    script.Parent.Position = Vector3.new (-164.7, 348.99, 171.3)
    wait (.5)
    script.Parent.Position = Vector3.new (-164.7, 347.99, 171.3)
    wait (.5)
    end
Report Abuse
Saviorofdragons is not online. Saviorofdragons
Joined: 10 Jan 2013
Total Posts: 489
26 Aug 2013 04:37 PM
You may wanna use CFrame instead of vector3. CFrame I don't believe has collision check
Report Abuse
sonofjupiter is not online. sonofjupiter
Joined: 12 Nov 2010
Total Posts: 251
26 Aug 2013 04:39 PM
mkay.
Report Abuse
sonofjupiter is not online. sonofjupiter
Joined: 12 Nov 2010
Total Posts: 251
26 Aug 2013 04:40 PM
So wait, how do I associate CFrame with it?

while true do
    wait(.00001)
    script.Parent.Position = CFrame.new (-164.7, 347.99, 171.3)
    wait (.5)
    script.Parent.Position = CFrame.new (-164.7, 345.99, 171.3)
    wait (.5)
    script.Parent.Position = CFrame.new (-164.7, 348.99, 171.3)
    wait (.5)
    script.Parent.Position = CFrame.new (-164.7, 347.99, 171.3)
    wait (.5)
    end

or something different..
Report Abuse
Saviorofdragons is not online. Saviorofdragons
Joined: 10 Jan 2013
Total Posts: 489
26 Aug 2013 04:42 PM
Yes, CFrame works almost exactly like Vector3 except for a few extra things that it can do
Report Abuse
sonofjupiter is not online. sonofjupiter
Joined: 12 Nov 2010
Total Posts: 251
26 Aug 2013 04:44 PM
It says in output

17:44:33.965 - Workspace.Wedge.Script:3: bad argument #3 to 'Position' (Vector3 expected, got userdata)
17:44:33.966 - Script 'Workspace.Wedge.Script', Line 3
17:44:33.966 - stack end
Report Abuse
Saviorofdragons is not online. Saviorofdragons
Joined: 10 Jan 2013
Total Posts: 489
26 Aug 2013 04:46 PM
Oh I forgot to tell you. It's not .Position it's .CFrame. So it is

Game.Workspace.Part.CFrame=CFrame.new(blah blahh blagh)
Report Abuse
sonofjupiter is not online. sonofjupiter
Joined: 12 Nov 2010
Total Posts: 251
26 Aug 2013 04:53 PM
Mkay, what would I do about rotation then?
Report Abuse
Saviorofdragons is not online. Saviorofdragons
Joined: 10 Jan 2013
Total Posts: 489
26 Aug 2013 04:54 PM
I think CFrame can cover rotation as well.
Report Abuse
sonofjupiter is not online. sonofjupiter
Joined: 12 Nov 2010
Total Posts: 251
26 Aug 2013 04:55 PM
mkay..
Report Abuse
sonofjupiter is not online. sonofjupiter
Joined: 12 Nov 2010
Total Posts: 251
26 Aug 2013 04:59 PM
That would just change the position, rather then the rotation.
Report Abuse
Saviorofdragons is not online. Saviorofdragons
Joined: 10 Jan 2013
Total Posts: 489
26 Aug 2013 05:02 PM
Game.Workspace.Part.CFrame.Angles(blah,blah,blahstuff) Sorry for not giving you all the information on my last post.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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