Bully-Board
Bully Modding Section => Modding Questions/Help => Topic started by: Ming on January 19, 2022, 08:24:48 PM
-
DeadCamera = function()
if IsButtonBeingPressed(2, 0) then
StarDeadTime = GetTimer()
repeat
TIME = (GetTimer() - StarDeadTime)/1000
DeltaX = r*math.cos(AngularVelocity*TIME + Angle0)
DeltaZ = TIME*ZConstant
gPX, gPY, gPZ = PedGetPosXYZ(gPlayer)
CameraLookAt = gPX, gPY, gPZ + 1.5
CameraPosition = gPX + DeltaX, gPY + 1, gPZ + 2 + DeltaZ
CameraSetXYZ(CameraPosition, CameraLookAt)
Wait(0)
until GetTimer() - StarDeadTime > 5000
CameraLookAtPlayer()
end
end
It doesn't work
-
I use simple harmonic motion to set the camera position btw
-
r, AngularVelocity, Angle0, YConstant variables is not defined(nil) and you're trying to operate it with arithmetic operation.
Correct me if I'm wrong.
-
r, AngularVelocity, Angle0, YConstant variables is not defined(nil) and you're trying to operate it with arithmetic operation.
Correct me if I'm wrong.
Thank you, but I fined it in main function
function main()
Wait(500)
r = 3
AngularVelocity = 30
Angle0 = 0
ZConstant = 1
while true do
DeadCamera()
Wait(0)
end
end