-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgearcontroller.lua
More file actions
28 lines (27 loc) · 920 Bytes
/
gearcontroller.lua
File metadata and controls
28 lines (27 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
behaviour("gearcontroller")
--local instance
function gearcontroller:Start()
self.vehicle = self.gameObject.GetComponent(Vehicle)
self.animator = self.targets.animator
self.check = 0
end
function gearcontroller:Update()
if self.vehicle.hasDriver then
if self.vehicle.driver == Player.actor then
if Input.GetKeyBindButtonDown(KeyBinds.Prone) then
if self.check == 0 then
self.check = 1
else
self.check = 0
end
self.animator.SetFloat("GearStat", self.check)
end
end
if self.vehicle.driver.isBot then
if self.check == 0 and self.vehicle.altitude > 20 then
self.check = 1
self.animator.SetFloat("GearStat", self.check)
end
end
end
end