|
| 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 |
|
|
|
| 26 Aug 2013 04:37 PM |
| You may wanna use CFrame instead of vector3. CFrame I don't believe has collision check |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 26 Aug 2013 04:53 PM |
| Mkay, what would I do about rotation then? |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2013 04:54 PM |
| I think CFrame can cover rotation as well. |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Aug 2013 04:59 PM |
| That would just change the position, rather then the rotation. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|