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: Camera Help

Previous Thread :: Next Thread 
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
28 Aug 2012 06:25 PM
My last few threads didn't help that much so here: Why does this script make me spawn Cframed in the middle of the map when I equipped the tool? Do I have to identify the position of the part?



local equip = false
local Tool = script.Parent

_G.waitForChild = (function (instance, child)

repeat
wait()
until instance:findFirstChild(child) ~= nil

return instance:findFirstChild(child)

end)

function Equipped(mouse)

wait()

equip = true

follow(mouse)

end

function follow(mouse)

part = Instance.new("Part", Tool.Parent)
part.Name = "MousePart"
part.Transparency = 1
part.Anchored = false
part.CanCollide = false
part.FormFactor = "Symmetric"
part.Size = Vector3.new(1, 1, 1)

local weld = Instance.new("Weld", part)
weld.Part0 = part
weld.Part1 = Tool.Parent.Torso
weld.C0 = CFrame.new(0, -1.5, 0)

local head = Tool.Parent.Head

while equip == true do

weld.C0 = (CFrame.new(head.CFrame.p, mouse.Hit.p) - head.CFrame.p):inverse() * (head.CFrame - head.Position) * CFrame.new(0, -1.5, 0)

wait()

end

end

function Unequipped()

equip = false
part:Destroy()

end

Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
Report Abuse
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
28 Aug 2012 06:31 PM
Bump... Sigh here we go again..
Report Abuse
agent767 is not online. agent767
Joined: 03 Nov 2008
Total Posts: 4181
28 Aug 2012 06:47 PM
Did you anchor the handle of the tool?
And don`t expect a reply after only 6 minutes.
Report Abuse
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
28 Aug 2012 06:49 PM
Wait a sec I dont think so why?
Report Abuse
agent767 is not online. agent767
Joined: 03 Nov 2008
Total Posts: 4181
28 Aug 2012 06:55 PM
"Cframed in the middle of the map when I equipped the tool?"
This happens when you anchor the handle or a part welded to it.
Report Abuse
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
28 Aug 2012 07:12 PM
Not anchored..
Report Abuse
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
29 Aug 2012 07:49 AM
Bump
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
29 Aug 2012 07:51 AM
Like I said last time,
Inverse the Part0 and Part1,
including the C0 and C1
Report Abuse
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
29 Aug 2012 07:54 AM
OH!!! I didnt Switch C0 and C1! I will try that right now..
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
29 Aug 2012 07:55 AM
Sorry I didn't make that clear,
I figured you might notice.
Report Abuse
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
29 Aug 2012 08:10 AM
I still spawn in the middle of the map... Well actually on theis llittle green baseplate below it.. I miswell just give you the two scripts casue I have no clue why it's still teleporting me..
Report Abuse
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
29 Aug 2012 08:24 AM
local weld = Instance.new("Weld", part)
weld.Part1 = part
weld.Part0 = Tool.Parent.Torso
weld.C1 = CFrame.new(0, -1.5, 0)

local head = Tool.Parent.Head

while equip == true do

weld.C1 = (CFrame.new(head.CFrame.p, mouse.Hit.p) - head.CFrame.p):inverse() * (head.CFrame - head.Position) * CFrame.new(0, -1.5, 0)

wait()

end

end
Report Abuse
QIB is not online. QIB
Joined: 27 Nov 2010
Total Posts: 45
29 Aug 2012 08:44 AM
Is the part positioned at your head or torso?
Report Abuse
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
29 Aug 2012 08:49 AM
No.. I dont think so how would I do that?
Report Abuse
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
29 Aug 2012 09:07 AM
part.Position = Torso.Position?
Report Abuse
Stripeyman879 is not online. Stripeyman879
Joined: 31 Jul 2008
Total Posts: 1726
29 Aug 2012 11:53 AM
Bump
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