|
| 06 Aug 2015 07:53 PM |
My script works. The problem is that when I touch it, it shakes and acts trippy. Here is the script:
local brick = script.Parent local start = brick.Rotation local endPos = start+Vector3.new(0,360,0) local enabled = false
brick.Touched:connect(function() if not enabled then enabled = true for i=0, 1, .01 do brick.Rotation = start:lerp(endPos, i) wait() end end enabled = false end)
Thanks in advance! |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 06 Aug 2015 08:13 PM |
part.CFrame = part.CFrame * CFrame.Angles(sin(90),0,0)
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
|
| 06 Aug 2015 08:16 PM |
local brick = script.Parent local start = brick.Rotation local endPos = start+Vector3.new(0,360,0) local enabled = false
brick.Touched:connect(function() if not enabled then enabled = true for i=0, 1, .01 do brick.Rotation = start:lerp(endPos, i) wait() end enabled = false end end)
set enabled to false only when your for loop is done
|
|
|
| Report Abuse |
|
|
| |
|
instawin
|
  |
| Joined: 04 Jun 2013 |
| Total Posts: 8777 |
|
| |
|
|
| 06 Aug 2015 08:23 PM |
math.sin()
ToxicDominator - 11,060 posts |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2015 08:26 PM |
| @instawin Just did. It resolves the shakiness, but I am able to make go up when I hit it. |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2015 08:27 PM |
it's because he used Vector3 replace sin with math.sin
ToxicDominator - 11,060 posts |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2015 08:30 PM |
| @airstriker4 Cool! That worked but is there a way to make it go slower? Without increasing the wait time?? |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
| |
|
|
| 06 Aug 2015 08:34 PM |
That did nothing... Here is my script:
local brick = script.Parent local enabled = false
brick.Touched:connect(function() if not enabled then enabled = true for i=0, 1, .01 do brick.CFrame = brick.CFrame*CFrame.Angles(0,math.sin(70),0) wait() end enabled = false end end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|