8Bawl
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 544 |
|
|
| 27 Jul 2011 08:11 PM |
| How do I make it so a model faces me?? I'm making an mini attack heli, everythings good besides the facing me thing >_< I'm stumped.. |
|
|
| Report Abuse |
|
|
8Bawl
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 544 |
|
| |
|
8Bawl
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 544 |
|
| |
|
madxr0
|
  |
| Joined: 20 Apr 2008 |
| Total Posts: 39 |
|
|
| 27 Jul 2011 08:31 PM |
Well, theres several diffrent methods to do this. First of all, you would need one brick in your "Model" controlling all of its movement, Typically reffered to as the "Engine".
Withing this brick you would ATLEAST need a BodyGyro
Then, you would need to be able to control the BodyGyro to face a certain direction. Preferably the lookVector of the engine.
Now, you need your script. local self = script.Parent local 8b = game.Workspace.8Bawl local bg = self.BodyGyro
Now, let's say you want this brick to target your torso local 8bt = 8b.Torso
Now, lets "Slave" the BodyGyro.
bg.cframe = CFrame.new(self.Position,bgt.Position)
Then put this into a loop.
while true do bg.cframe = CFrame.new(self.Position,bgt.Position) wait(1) end
Therefore, you would have---
local self = script.Parent local 8b = game.Workspace.8Bawl local bg = self.BodyGyro local 8bt = 8b.Torso
while true do bg.cframe = CFrame.new(self.Position,bgt.Position) wait(1) end
You may have to adjust the Torque of the BG.
|
|
|
| Report Abuse |
|
|
8Bawl
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 544 |
|
| |
|
8Bawl
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 544 |
|
|
| 27 Jul 2011 09:33 PM |
@Mad, can you make this aim twards my torso? >_< It only aims in one direction D:
local self = script.Parent.Engine local bb = game.Workspace:findFirstChild(script.Parent.Following.Value) local bg = self.BodyGyro local move = self.Fly local bbt = bb.Torso
bg.cframe = CFrame.new(self.Position,bbt.Position)
while true do move.position = bbt.Position + Vector3.new(5,0,5) bg.cframe = CFrame.new(self.Position,bbt.Position) wait() end
local self = script.Parent.Engine local bb = game.Workspace:findFirstChild(script.Parent.Following.Value) local bg = self.BodyGyro local bbt = bb.Torso
while true do move.position = bbt.Position + Vector3.new(5,0,5) bg.cframe = CFrame.new(self.Position,bbt.Position) wait() end
|
|
|
| Report Abuse |
|
|
|
| 27 Jul 2011 09:41 PM |
| If it aims only in 1 direction, it's not finding your torso. |
|
|
| Report Abuse |
|
|
8Bawl
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 544 |
|
|
| 28 Jul 2011 08:53 AM |
| Can you make it face my torso please? >:\ |
|
|
| Report Abuse |
|
|
| |
|
8Bawl
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 544 |
|
|
| 28 Jul 2011 09:16 AM |
| Unnecessary content above ^ |
|
|
| Report Abuse |
|
|