Jump to content

Yue

Members
  • Posts

    2,303
  • Joined

  • Last visited

Everything posted by Yue

  1. Upgrade to version 4.6, the same model scales it from 1 to 0.1 in all its respective axes, however it still does not work.
  2. If perfect, I have understood it by force, try after try, a spring, the same happens with certain words, for example Handle tells me that it is a green tropical fruit. I suppose everything would be easier if he spoke English, but I think that with the persistence I already have a car system that I imagined impossible before, and it all started with your suggestion of springs, sliding joints and hinge joints. Translated with www.DeepL.com/Translator
  3. Thank you, the truth is that the translator is often a real problem. Spring to Spanish equals "Primavera" "Primavera" in Spanish I understand is a time of year, along with winter, fall and summer. That's why I think the best way is to make the videos.
  4. Okay, here's the model in question. Chassis.fbx
  5. I'm telling you that if he didn't activate the engine, he's still bouncing the tires a lot, even if he puts a value of 1 in the spring. I'm going to make a video to explain it better, the thing is that the translator doesn't help me much.
  6. I'm going to go down to 4.5 and make a video of importing the same model.
  7. I want to note that the model is imported correctly in leadwerks 4.5.
  8. I'm going to upgrade back to version 4.6, and make a video and put it here.
  9. How can I avoid this behavior? Script Lua. Script.rueda = nil --entity "Rueda" Script.chassis = nil --entity "Chassis" function Script:Start() self.posAmortiguador = self.entity:GetPosition() self.Amortiguador = Joint:Slider(self.posAmortiguador.x, self.posAmortiguador.y, self.posAmortiguador.z, 0,1,0, self.entity, self.chassis) self.Amortiguador:SetSpring(200 ) self.Amortiguador:EnableLimits() self.Amortiguador:SetLimits( 0, 0.01) self.Amortiguador:EnableMotor() self.Amortiguador:SetTargetAngle(0) self.posMotor = self.rueda:GetPosition() self.Motor = Joint:Hinge( self.posMotor.x, self.posMotor.y, self.posMotor.z, 0, 0, 1, self.rueda, self.entity ) self.Motor:DisableLimits() self.rueda:SetPickMode( 0 ) self.entity:SetPickMode( 0 ) self.rueda:SetFriction(1, 1 ) end local vel = 0 function Script:UpdateWorld() self.Motor:DisableMotor() if window:KeyDown(Key.W) then self.Motor:EnableMotor() self.Motor:SetAngle( self.Motor:GetAngle() - 100 ) if vel <=500 then vel = vel + 10 end end if window:KeyDown(Key.S) then self.Motor:EnableMotor() self.Motor:SetAngle( self.Motor:GetAngle() + 100 ) if vel <=500 then vel = vel + 10 end end self.Motor:SetMotorSpeed( vel ) end
  10. I tried to import a model, but it doesn't matter, I'm already back in 4.5, the error was that only one pivot was imported and the model was not visible in the model viewer in 4.6
  11. The model importer in Leadwerks is broken, I have to go back to 4.5 to import my fbx model correctly.
  12. I'm telling you that nothing is perfect, I've made some progress but I'm a long way from being a game, it's just a riddle to solve. The new problem is a mistake that happens when the vehicle falls from the top, the suspensions behave incorrectly. I welcome any suggestions. Script Wheel.lua Script.rueda = nil --entity "Rueda" Script.chassis = nil --entity "Chassis" function Script:Start() self.posAmortiguador = self.entity:GetPosition() self.Amortiguador = Joint:Slider(self.posAmortiguador.x, self.posAmortiguador.y, self.posAmortiguador.z, 0,1,0, self.entity, self.chassis) self.Amortiguador:SetSpring(200 ) self.Amortiguador:EnableLimits() self.Amortiguador:SetLimits( 0, 0.01) self.Amortiguador:EnableMotor() self.posMotor = self.rueda:GetPosition() self.Motor = Joint:Hinge( self.posMotor.x, self.posMotor.y, self.posMotor.z, 0, 0, 1, self.rueda, self.entity ) self.Motor:DisableLimits() self.rueda:SetPickMode( 0 ) self.entity:SetPickMode( 0 ) self.rueda:SetFriction(5, 5 ) end local vel = 0 function Script:UpdateWorld() self.Motor:DisableMotor() if window:KeyDown(Key.W) then self.Motor:EnableMotor() self.Motor:SetAngle( self.Motor:GetAngle() - 100 ) if vel <=500 then vel = vel + 10 end end if window:KeyDown(Key.S) then self.Motor:EnableMotor() self.Motor:SetAngle( self.Motor:GetAngle() + 100 ) if vel <=500 then vel = vel + 10 end end self.Motor:SetMotorSpeed( vel ) end
  13. When you know nothing and have to learn by brute force, trial and error, I don't like to copy other people's things, I like to try to understand things, and in a certain way when I can't learn something to decline and stop insisting. But this struggle, even though it goes on alone, today I have learned something new. Only one wheel moved because it had to declare the variable as Self.Wheel = Joint:Hinge. In this case all the tires move with the same script and climb the slope without problems. Translated with www.DeepL.com/Translator
  14. https://youtu.be/xKO3Uk-ivQk
  15. I have discovered something, the previous script is assigned to all the tires, I would expect it to work correctly, for example when I put self.pull:Hide(), the four wheels disappear, this seems to be fine, because the script is assigned to four elements that are the tires, however if I put if window:KeyDown(Key.Up) then engine:SetAngle( engine:GetAngle() - 100 ) if vel <= 200 then vel = vel + 10 end end Only one tire gets the strength to move the vehicle, any suggestions please? Translated with www.DeepL.com/Translator
  16. My car still can't climb slopes. Any suggestions? I have the following script assigned to each tire of the vehicle, I think from my logic it should work. But it doesn't work. -- Script Spring. Script.chassis = nil --entity "Chassis" Script.llanta = nil --entity "Llanta" --Spring local suspension -- motor local motor local vel = 0 function Script:Start() --[[ --Slider. suspension = Joint:Slider(self.entity:GetPosition().x, self.entity:GetPosition().y, self.entity:GetPosition().z, 0, 1, 0, self.chassis, self.entity ) --suspension:EnableLimits() --suspension:SetLimits(-0.01,-0.05 ) suspension:SetSpring(200) suspension:EnableMotor() suspension:SetTargetAngle(0) suspension:SetMotorSpeed(1) suspension:SetStrength(100) ]] --Hinge. motor = Joint:Hinge( self.llanta:GetPosition().x, self.llanta:GetPosition().y, self.llanta:GetPosition().z, 0, 0, 1, self.llanta, self.chassis ) motor:DisableLimits() --self.llanta:SetFriction(10, 10 ) motor:SetTargetAngle(0) end function Script:UpdateWorld() if window:KeyDown(Key.Up) then motor:SetAngle( motor:GetAngle() + 100 ) motor:EnableMotor() vel = vel + 10 end if window:KeyDown(Key.Space) then motor:DisableMotor() vel = 0 end if window:KeyDown(Key.Down) then motor:SetAngle( motor:GetAngle() - 100 ) motor:EnableMotor() vel = vel -10 end motor:SetMotorSpeed( vel ) end
  17. It's unfortunate, this doesn't work for me, it doesn't go up the inclined ramp. -- Script Spring. Script.chassis = nil --entity "Chassis" Script.llanta = nil --entity "Llanta" --Spring local suspension -- motor local motor local vel = 0 function Script:Start() --Slider. suspension = Joint:Slider(self.entity:GetPosition().x, self.entity:GetPosition().y, self.entity:GetPosition().z, 0, 1, 0, self.entity, self.chassis ) --suspension:EnableLimits() --suspension:SetLimits(-0.01,-0.05 ) suspension:SetSpring(200) --suspension:EnableMotor() --Hinge. motor = Joint:Hinge( self.llanta:GetPosition().x, self.llanta:GetPosition().y, self.llanta:GetPosition().z, 0, 0, 1, self.llanta, self.entity ) motor:DisableLimits() self.llanta:SetFriction(10, 10 ) end function Script:UpdateWorld() motor:SetAngle( motor:GetAngle() - 100 ) vel = vel + 100 motor:EnableMotor() motor:SetMotorSpeed( vel ) end
×
×
  • Create New...