Jump to content

Yue

Members
  • Posts

    2,307
  • Joined

  • Last visited

Everything posted by Yue

  1. https://youtu.be/xKO3Uk-ivQk
  2. 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
  3. 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
  4. 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
  5. There's definitely something wrong here, and I might have to start over.
  6. My forklift doesn't go up this ramp. Any suggestions, my friend? -- Script Spring. Script.chassis = nil --entity "Chassis" Script.llanta = nil --entity "Llanta" --Spring local suspension -- motor local motor 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 ) --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(1000, 1000 ) end function Script:UpdateWorld() --if self.entity:GetKeyValue("type", "Suspension0") == "Suspension0" then motor:SetAngle( motor:GetAngle()-100) motor:EnableMotor() motor:SetMotorSpeed(100000000) --end end
  7. I have four tires, a script that is used on all four tires to set the suspension and hinge for the engine of each tire. My question is, how do I retrieve the name of that entity associated with that script? it's with the goal of only setting the engine for two tires. Any suggestions? -- Script Spring. Script.chassis = nil --entity "Chassis" Script.llanta = nil --entity "Llanta" --Spring local suspension -- motor local motor 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 ) --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() end function Script:UpdateWorld() if self.entity:GetKeyValue("type", "") == "Suspension0" then self.llanta:Hide() --motor:SetAngle( motor:GetAngle()+100) --motor:EnableMotor() --motor:SetMotorSpeed(1000) end end
  8. Thank you, the problem has been solved, undoubtedly something new to learn about "Debris" that translates into Spanish as rubble, very small things. Thank you very much.
  9. If that seems to be the case, there are some commands to disable the tires from colliding with the chassis? any suggestions are welcome. dfsdf
  10. I have a problem, when I want to put the tires in the respective place of the chassis of my vehicle, the car starts to jump like crazy. Any suggestions?
  11. I understand that the slope goes up with enough momentum, however if you stop on a slope like that, you will most likely not go up. Then I thought about the gears of a car and the question is how realistic is the question
  12. Listen to a question, how is it possible that you climb steep hills, in my case the car doesn't get in, it runs out of strength.
  13. I understand the concept of hinge, ball and slider in the joints. Only with hinges I am able to implement a simple prototype of wheels, when you already understand everything is very easy, however if I put suspension to the wheel, the hinge of articulation is blocked for its movement, Any suggestions? --Script for tire on Vehicle Script.chassis = nil --entity "Chassis" local motor local amortiguador function Script:Start() motor = Joint:Hinge(self.entity:GetPosition().x, self.entity:GetPosition().y, self.entity:GetPosition().z, 0, 0, 1, self.entity, self.chassis ) motor:DisableLimits() -- Error here. --[[ amortiguador = Joint:Slider(0, 0, 0, 0, 1, 0, self.entity, self.chassis ) amortiguador:EnableLimits() amortiguador:SetLimits(-0.2, 0.2 ) amortiguador:EnableMotor() ]] end
  14. Yue

    Joints

    Ok, I've already understood something, and I really appreciate your help, as the google translator isn't that helpful with the documentation. With this broken hinge. if self.motorspeed>0 then bisagra:SetAngle(bisagra:GetAngle()+100) else bisagra:SetAngle(bisagra:GetAngle()-100) end And with this I set the speed of rotation. bisagra:SetMotorSpeed(self.motorspeed) I feel that I have learned something new today, tomorrow will be another day and I will realize that there are things that I still don't know. Thank you very much.
  15. Yue

    Joints

    And now the question is, how do I give the tire the power it needs to have engine effect in the car? When I activate the engine, I see it only goes in one direction.
  16. Yue

    Joints

    Okay, thank you very much, I thought if the father was set, he'd take the father's coordinates to set the hinge coordinates. Now then I just have to create the hinge in the middle of the door, this would work like a revolving door, am I right?, is for the purpose of creating a tire. bisagra = Joint:Hinge( self.entity:GetPosition().x, self.entity:GetPosition().y, self.entity:GetPosition().z, 0, 1, 0, self.puerta , self.entity) bisagra:EnableLimits()
  17. Yue

    Joints

    I can understand many things but I can't apply them correctly, I want to make a simple door with a hinge, but it seems that the center point is at the global level of the scene and not in the door frame. -- Puerta = Door. -- self.entity = Frame -- Bisagra = Hinge bisagra = Joint:Hinge( 0, 0, 0, 0, 1, 0, self.puerta, self.entity ) bisagra:EnableLimits()
  18. Creating a rim system, Sliding joint in Lua scrpit. Any suggestions?
  19. Well, we know it's January, but we don't know the year. ?
  20. Yue

    Multiple Shadows

    I'm really impressed by anything, those images look great, and it's really amazing what a person who is a real multimedia-focused system developer can do.
  21. I guess it's a long way off, he's now 100% busy on leadwerks 5 ("Turbo") and Leadwerks is not his priority at the moment.
  22. I appreciate your answer, and I apologize if my questions bother you since I'm a rookie.
  23. Thanks for the answer, however the current version does not support the car physics system. Johs recommends me to do it through unions. The thing is that I can't find a simple example of ball joints, hinges, shock absorbers to apply to a car, and not by the car physics system that is currently broken.
  24. Ok, I have solved the problem, just something to comment, only this shows that I am not a programmer, the solution was to put the shader with animations, and on the other hand it shows that my biggest drawback is that I do not speak English.
  25. Something strange happens here, I can't execute the animations, in the game only the character's shadow is animated, but not the character, and in the character viewer The character is not animated, any suggestions?
×
×
  • Create New...