generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

How?

Previous Thread :: Next Thread 
8Bawl is not online. 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 is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
27 Jul 2011 08:21 PM
Bump>?
Report Abuse
8Bawl is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
27 Jul 2011 08:26 PM
Any help please??? D:
Report Abuse
madxr0 is not online. 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 is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
27 Jul 2011 08:32 PM
Thankz >:3
Report Abuse
8Bawl is not online. 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
EpikYummeh is not online. EpikYummeh
Joined: 05 Sep 2009
Total Posts: 1879
27 Jul 2011 09:41 PM
If it aims only in 1 direction, it's not finding your torso.
Report Abuse
8Bawl is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
28 Jul 2011 08:53 AM
Can you make it face my torso please? >:\
Report Abuse
ironbuffalo2000 is not online. ironbuffalo2000
Joined: 22 Jul 2011
Total Posts: 4
28 Jul 2011 09:11 AM
cool
Report Abuse
8Bawl is not online. 8Bawl
Joined: 24 Jun 2011
Total Posts: 544
28 Jul 2011 09:16 AM
Unnecessary content above ^
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image