samy22
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2181 |
|
|
| 16 Apr 2014 02:46 PM |
| Is there a way to use a bodymover to make a brick constantly face a certain position from where its current position is (so it looks at it you could say and it is unanchored). This is just like how bodyposition makes a brick constantly stay at a position but I want a way for it to constantly face that position. |
|
|
| Report Abuse |
|
|
| |
|
samy22
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2181 |
|
|
| 16 Apr 2014 02:57 PM |
Thanks, after looking at the wiki, i tried this but it didn't work, any idea why?
while true do wait() script.Parent.cframe = game.Workspace.Part.CFrame end
The script.Parent was the bodygyro itself; no rotation occured |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 16 Apr 2014 03:01 PM |
| Turn up the .maxTorque property |
|
|
| Report Abuse |
|
|
samy22
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2181 |
|
|
| 16 Apr 2014 03:06 PM |
| Ah it worked! It was able to tilt/rotate whenever i rotated and tilted this other Part... However, i wanted it to be constantly pointing towards it which it wasn't doing, how do i do that? |
|
|
| Report Abuse |
|
|
samy22
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2181 |
|
| |
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 16 Apr 2014 03:47 PM |
Try
.cframe = CFrame.new(target.CFrame.p) |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 16 Apr 2014 03:53 PM |
Thanks, after looking at the wiki, i tried this but it didn't work, any idea why?
while true do wait() script.Parent.cframe = game.Workspace.Part.CFrame end
The script.Parent was the bodygyro itself; no rotation occured
while RenderStepped() do --While true do wait() takes up more space, and while wait() do is identical functionally. While RenderStepped() do gives you a very short wait that lasts one render frame or 1/60th of a second.
--Get the unit vector between your part and the part you're pointing at it, then pass that to the part you're pointing at the other part. Too lazy to dabble in cframing today, and I don't know it well enough.
(partYouArePointingTowards.CFrame.p - partYouArePointingToOtherPart.CFrame.p).unit I believe it is to get the unit vector.
I also believe there is a LookAt or similar property of a cframe in a part, or a PointToWorldSpace or something. You might need to look that up.
end |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 17 Apr 2014 06:52 AM |
| Power, RenderStepped is an event, not a function like wait(). Gotta connect it, man. |
|
|
| Report Abuse |
|
|