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: Pointlight real bumpy in First person??

Previous Thread :: Next Thread 
ninjafang7818292 is not online. ninjafang7818292
Joined: 11 Sep 2010
Total Posts: 504
31 May 2013 07:23 PM
I have an animation script that makes your "Right Arm" Follow the cursor. I made a flashlight but the point-light is rather bumpy when looking around.


Maybe its something wrong with the scripts or Roblox in general?

Well here is the animation arm script.


wait()
Tool=script.Parent
CP,Torso,g=nil,nil,nil
necko=CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
getPos=function(Pos,TorsoPos)
return Vector3.new(Pos.x,TorsoPos.y,Pos.z)
end
Turn=function(mouse,Torso,Gyro)
g.cframe=CFrame.new(Torso.Position,getPos(mouse.Hit.p,Torso.Position))
offset=(Torso.Position.y-mouse.Hit.p.y)/100
mag=(Torso.Position-mouse.Hit.p).magnitude/80
offset=offset/mag
neck=Torso.Neck
neck.C0=necko*CFrame.fromEulerAnglesXYZ(offset,0,0)
arm=Torso:FindFirstChild("Right Shoulder")
if arm~=nil then
arm.C0=CFrame.new(1, 0.5, 0, 0, 0, 1, -6.48200512e-007, 1.00000274, 0, -1.00000274, -6.48200512e-007, 0)*CFrame.fromEulerAnglesXYZ(0,0,-offset)
end
end
Equi=function(mouse)
wait(.2)
CP=Tool.Parent
Torso=CP.Torso
g=Instance.new("BodyGyro")
g.P=18000
g.D=600
g.maxTorque=Vector3.new(80000,80000000,80000)*50000000000000000000000000
g.cframe=Torso.CFrame
g.Parent=Torso
while true do
if Tool.Parent.className~="Model" then
break
end
Turn(mouse,Torso,g)
wait()
end
Torso.Neck.C0=necko
g:Remove()
end
Tool.Equipped:connect(Equi)
Report Abuse
ninjafang7818292 is not online. ninjafang7818292
Joined: 11 Sep 2010
Total Posts: 504
31 May 2013 07:24 PM
Here is the Pointlight Property Settings.

Angle: 70
Brightness:2
Color: 255,255,255
Enabled = true
Range:20
Report Abuse
ninjafang7818292 is not online. ninjafang7818292
Joined: 11 Sep 2010
Total Posts: 504
31 May 2013 07:28 PM
Bump.

How would I make it much Smoother?
Report Abuse
DaneelOlivaw is not online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
31 May 2013 07:34 PM
It's how lighting works, has nothing to do with scripting.

Sorry.
Report Abuse
marcopolo444 is not online. marcopolo444
Joined: 02 May 2010
Total Posts: 5114
31 May 2013 07:36 PM
You might be able to make it so that it constantly removes the light and creates a new pointlight, but I can't guarantee that working.
Report Abuse
ilikehandy123 is not online. ilikehandy123
Joined: 19 Sep 2012
Total Posts: 67
31 May 2013 07:38 PM
@marcopolo444 That could make it flash just some, and it may not even help.
Report Abuse
ShadowOfCrimson is not online. ShadowOfCrimson
Joined: 14 Dec 2009
Total Posts: 2153
31 May 2013 07:41 PM
the lighting system doesn't update fast enough right now, nothing to do with scripting

~Shadow~
Report Abuse
Figure65 is not online. Figure65
Joined: 23 May 2007
Total Posts: 2663
31 May 2013 07:41 PM
what marcopolo said actually could be a good idea

it removes the pointlight and adds a new one every () seconds
if it was fast enough, it wouldn't just flash, it might just auto update so fast that it would look natural
Report Abuse
marcopolo444 is not online. marcopolo444
Joined: 02 May 2010
Total Posts: 5114
31 May 2013 07:43 PM
-- like this?


while true do
wait(0.02)
a = Instance.new("PointLight").Parent = game.Workspace.Part
wait()
a:remove()
end
Report Abuse
Figure65 is not online. Figure65
Joined: 23 May 2007
Total Posts: 2663
31 May 2013 07:46 PM
or like this

while true do
script.Parent.PointLight:Remove
wait()
Instance.new("PointLight", script.Parent)
wait()
end


if that script goes fast enough, it shouldn't look like it's flickering
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
31 May 2013 07:47 PM
But that would be incredibly inefficient.
Report Abuse
Figure65 is not online. Figure65
Joined: 23 May 2007
Total Posts: 2663
31 May 2013 07:50 PM
i'm not sure if you're calling marco's idea inefficient, but if you are, i agree

it would be ineffecient and probably lag a bit on slower computers but that might be a way around OP's problem
Report Abuse
ninjafang7818292 is not online. ninjafang7818292
Joined: 11 Sep 2010
Total Posts: 504
31 May 2013 07:53 PM
Thanks for the help! :D
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