|
| 20 Aug 2014 04:03 AM |
Im trying to make a part move, here is the script: function move a=(a+1) b=(b+1) c=(c+1) game.Workspace.Part.Position= a,b,c end a=-68.795 b=0.59 c=78.542 game.Workspace.Part.Position= a,b,c wait(1) move wait(1) move wait(1) move wait(1) move wait(1) move wait(1) move wait(1) move wait(1) move wait(1) move
This is what it says in output:Workspace.Moving Part.Script:6: unexpected symbol near '=
Can someone help me? I cant fix it. Also, I am just a beginner, so this is hard... Thanks! |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 20 Aug 2014 04:20 AM |
a=-68.795 b=0.59 c=78.542
function move() a=(a+1) b=(b+1) c=(c+1) game.Workspace.Part.Position= Vector3.new(a,b,c) end
game.Workspace.Part.Position= Vector3.new(a,b,c) wait(1) move()
This might help you understand functions http://wiki.roblox.com/index.php?title=Function
|
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Aug 2014 10:39 AM |
you need to use CFrame Vector3 works and is easier but CFrame is better
http://wiki.roblox.com/index.php?title=CFrame |
|
|
| Report Abuse |
|
|
| |
|
oatsssss
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 170 |
|
|
| 23 Aug 2014 04:11 AM |
| What makes CFrames better in this case? |
|
|
| Report Abuse |
|
|
Roblok1
|
  |
| Joined: 27 Jul 2011 |
| Total Posts: 2019 |
|
|
| 23 Aug 2014 04:25 AM |
| if u use position, the object will just move on top of any object that may be in the way of the target. if u use CFrame, the object will be moved inside of any objects that may be in the way. |
|
|
| Report Abuse |
|
|
oatsssss
|
  |
| Joined: 31 Jul 2014 |
| Total Posts: 170 |
|
|
| 23 Aug 2014 04:28 AM |
| Whoa, I didn't know position did collision checking. That's good to know. |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Aug 2014 05:39 PM |
I hate when people say CFrame is better than Vector3. A Vector3 is derived from CFrame, it's like saying an engine is better than a car (a car that has an engine, of course). |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Aug 2014 05:40 PM |
A car is better than an engine* but you get the point.
The way roblox handles the collision detection is not due to Vector3 but due to the Position and Rotation properties (which is MEANT for collision-detection) |
|
|
| Report Abuse |
|
|