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
 

Re: lookVector

Previous Thread :: Next Thread 
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
13 Dec 2013 04:35 PM
local player = game.Players.LocalPlayer
local cam = workspace.CurrentCamera
local mouse = player:GetMouse()
local speed = 40

-- mouse box is 100 up 100 down

repeat wait() until player
print("Prepping for launch")
wait(3)
print("Reay for launch")
wait(1)
local plane = game.Lighting.Plane:clone()
plane.Parent = workspace
local float = Instance.new("BodyForce",plane)
float.force = Vector3.new(0,plane:GetMass() * 196.1,0)
cam.CameraSubject = plane
cam.CameraType="Scriptable"
while wait() do
cam:Interpolate(CFrame.new(plane.CFrame.p)+ Vector3.new(0,5,30),CFrame.new(plane.CFrame.p)+ Vector3.new((mouse.X * .2) + plane.Position.X,(mouse.Y * -.2) + plane.Position.Y, plane.Position.Z),.5)

plane.Velocity = cam.Focus.lookVector * speed

end

Ok so the camera interpolates but the plane doesn't change course it stays the same?
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
13 Dec 2013 04:47 PM
bump
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
13 Dec 2013 04:56 PM
As far as I can tell, you only tell the plane to go the way its looking. Maybe try something like this?

local courseChange = CFrame.Angles(0,math.pi/254,0)
plane.Velocity = CFrame.new(cam.Focus.lookVector * speed) * courseChange
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
13 Dec 2013 05:01 PM
but vlocity is a vector3 value???
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
13 Dec 2013 05:18 PM
velocity*
Report Abuse
getkoed is not online. getkoed
Joined: 18 Feb 2010
Total Posts: 2298
13 Dec 2013 05:20 PM
CFrame I think.
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
13 Dec 2013 05:28 PM
nop Velocity is Vector3
Report Abuse
getkoed is not online. getkoed
Joined: 18 Feb 2010
Total Posts: 2298
13 Dec 2013 05:29 PM
sorry thought you said lookVector

well then make it Vector3 xD
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
13 Dec 2013 05:30 PM
no no no I just don't understand how I can change CFrame.Angles to be a vector sorta thing. or do I have to?
Report Abuse
getkoed is not online. getkoed
Joined: 18 Feb 2010
Total Posts: 2298
13 Dec 2013 05:31 PM
local courseChange = CFrame.Angles(0,math.pi/254,0)
plane.Velocity = Vector3.new(cam.Focus.lookVector * speed) * courseChange

probably :d
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
13 Dec 2013 05:33 PM
xD worth a try
Report Abuse
ToboboT is not online. ToboboT
Joined: 25 Jun 2011
Total Posts: 2385
13 Dec 2013 05:49 PM
nop
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
13 Dec 2013 07:58 PM
To change CFrame to Vector3 do

local cf = CFrame.new()
local v3 = cf.p
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