Jump to content

#code

Members
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

2 Neutral

About #code

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. #code

    Slider joints

    I change script: Script.TireMass = 5 Script.SpringForce = 1000 function Script:Start() self.Wheels={} self.Wheels[0]=self.entity:FindChild("WheelFL") self.Wheels[1]=self.entity:FindChild("WheelFR") self.Wheels[2]=self.entity:FindChild("WheelRL") self.Wheels[3]=self.entity:FindChild("WheelRR") self.Amortisseurs={} self.Axis={} self.SecondAxis={} for n=0,3 do pos=self.Wheels[n]:GetPosition(true) self.Axis[n]=Pivot:Create(self.entity)-- self.Axis[n]:SetPosition(pos, true) axe=Vec3(0, 1, 0) self.Amortisseurs[n]=Joint:Slider(pos.x, pos.y, pos.z, axe.x,axe.y,axe.z, self.Axis[n], self.entity) self.Amortisseurs[n]:EnableLimits() self.Amortisseurs[n]:SetLimits(-1,1) self.Amortisseurs[n]:SetSpring(self.SpringForce,0.25,5) end self.Volants={} for n=0,1 do axe=Vec3(0, 1, 0) self.SecondAxis[n] = Pivot:Create(self.Axis[n])-- pos=self.Wheels[n]:GetPosition(true) self.SecondAxis[n]:SetPosition(pos, true) self.Volants[n]=Joint:Hinge(pos.x, pos.y, pos.z, axe.x,axe.y,axe.z, self.SecondAxis[n], self.Axis[n]) self.Volants[n]:EnableLimits() self.Volants[n]:SetLimits(-30,30) self.Volants[n]:SetMotorSpeed(200) self.Volants[n]:EnableMotor() self.Volants[n]:SetAngle(0) end for n=2,3 do pos=self.Wheels[n]:GetPosition(true) axe=Vec3(1, 0, 0) self.Volants[n]=Joint:Hinge(pos.x, pos.y, pos.z, axe.x,axe.y,axe.z, self.Wheels[n], self.Axis[n]) self.Volants[n]:EnableLimits() self.Volants[n]:SetLimits(-30,30) self.Volants[n]:SetMotorSpeed(200) self.Volants[n]:EnableMotor() self.Volants[n]:SetAngle(0) end self.ThirdAxis={} for n=0,1 do pos=self.Wheels[n]:GetPosition(true) axe=Vec3(1, 0, 0) self.ThirdAxis[n]=Joint:Hinge(pos.x, pos.y, pos.z, axe.x,axe.y,axe.z, self.Wheels[n], self.SecondAxis[n]) self.ThirdAxis[n]:EnableLimits() self.ThirdAxis[n]:SetLimits(-30,30) self.ThirdAxis[n]:SetMotorSpeed(200) self.ThirdAxis[n]:EnableMotor() self.ThirdAxis[n]:SetAngle(0) end end --[[ function Script:UpdateWorld() end ]] function Script:UpdatePhysics() end --[[ --This can be used to select which objects an entity collides with. This overrides collision types completely. function Script:Overlap(e) return Collision:Collide end ]] --[[ function Script:Collision(entity, position, normal, speed) end ]] --[[ function Script:Draw() end ]] --[[ function Script:DrawEach(camera) end ]] --This function will be called after the world is rendered, before the screen is refreshed. --Use this to perform any 2D drawing you want the entity to display. function Script:PostRender(context) end --[[ --This function will be called when the entity is deleted. function Script:Detach() end ]] --[[ --This function will be called when the last instance of this script is deleted. function Script:Cleanup() end ]] --[[ --This function will be called upon completion of a one-shot animation played with the PlayAnimation() command. function Script:EndAnimation(sequence) end ]] But nothing happens. Запись_2019_05_04_13_23_40_651.mp4 MyCar.rar
  2. You can use, for example, Riftcat to emulating HTC Vive. https://riftcat.com/vridge. It's support daydream and gear controller. And you can emulate controllers, use app from google play.
  3. #code

    Slider joints

    Hello, it's me again. And I'm trying to make joint: Slider shock absorbers. But something goes wrong, and I can not understand that. Please explain how this works. I need the car to fall to the ground and spin the shock absorbers. Code in RaceCar.lua: Script.TireMass = 20 Script.SpringForce = 1000 function Script:Start() self.Wheels={} self.Wheels[0]=self.entity:FindChild("WheelFL") self.Wheels[1]=self.entity:FindChild("WheelFR") self.Wheels[2]=self.entity:FindChild("WheelRL") self.Wheels[3]=self.entity:FindChild("WheelRR") self.Axes={} for n=0,3 do self.Axes[n]=Pivot:Create() self.Axes[n]:SetPosition(self.Wheels[n]:GetPosition()) self.Axes[n]:SetMass(self.TireMass) end self.Directions={} for n = 0, 1 do self.Directions[n]=Pivot:Create(self.Axes[n]) self.Directions[n]:SetPosition(self.Axes[n]:GetPosition()) end for n=2,3 do self.Wheels[n]:SetParent(self.Axes[n]) end for n=0,1 do self.Wheels[n]:SetParent(self.Directions[n]) end for n=0,3 do pos=self.Axes[n]:GetPosition(true) axe=Vec3(0, 1, 0) self.Amortisseurs={} self.Amortisseurs[n]=Joint:Slider(pos.x, pos.y, pos.z, axe.x,axe.y,axe.z, self.Axes[n], self.entity) self.Amortisseurs[n]:EnableLimits() self.Amortisseurs[n]:SetLimits(-1,1) self.Amortisseurs[n]:SetSpring(self.SpringForce,0.25,5) end end And video: What.mp4
  4. 'Without bridge bug2.mp4
  5. I think I know what the problem is, but I don't know how to solve it. First, you need to remove the bridge in the corner of the map, because it is not completed. But it's not about him. If you remove it, then the following happens: when I press the space bar (handbrake), the car starts to skid, and when it starts to fall the game crashes. What to do? Is this a known issue?
  6. *Don't forget to add --in or --out keys in script.
  7. I'm using a Vehicle script.lua from FPS template. Once I start driving, after a while, the leadwerks just crashes. Tell me what to do. bug.mp4 LeadwerksRacingTemplate.rar
  8. #code

    player entity

    Hello, tell me how to get the entity of the player?
  9. #code

    Vehicle

    Hi! Could you tell me please, as eliminate failure wheels?
  10. #code

    VehicleAgain

    I do not even see the error, the game just crashes.
  11. #code

    VehicleAgain

    Hi. I'm still trying to create a vehicle. I seem to have made it from the example of the workshop, but when I want to get on the bus, an error appears, something about nil value. I am waiting for help, I attach the project. https://yadi.sk/d/b77bSHYwp-EgHQ
  12. #code

    Vehicle

    Hi. I want to make a managed vehicle, but found no examples other than what lies in the REFERENCE API. Please tell me how to implement it if I have an FBX model with a body and four separate wheels.
×
×
  • Create New...