Yue Posted November 13, 2017 Share Posted November 13, 2017 function Script:Start() -- Creando Vehiculo. vehiculo = Vehicle:Create(self.entity ) if vehiculo:Build()==false then Debug:Error("Failed to build vehicle.") end end I'm trying to create a vehicle system, but I haven't been successful. Any suggestions? A simple example? What am I doing wrong. Greetings. Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 14, 2017 Share Posted November 14, 2017 Just in case you do not realize, but there is a search function built into the forum. I think you will find it helps answer a lot of questions. The following are from just typing 'vehicle' into the search... note that vehicles have been in the process of being reworked for quite awhile now and may not be stable. 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Yue Posted November 14, 2017 Author Share Posted November 14, 2017 Thank you very much. I have some confusion problems, I don't know how to turn the chassis properly. Any suggestions? Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 14, 2017 Share Posted November 14, 2017 I personally haven't really tried vehicles since LE2, but I assume that vehicle:SetSteering(angle) will do it. Have you tried the example shown for vehicles in the leadwerks documentation to see if it works? 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Yue Posted November 14, 2017 Author Share Posted November 14, 2017 Yes, I solved the problem, turn the model from blender and I already have it. However, I have another inconvenience, and that is that the suspension is very high, when the vehicle does not touch the ground, the tires go down a lot from the chassis. Something tells me that I have to make the model of the vehicle bigger, but I don't rule out the possibility that there is a parameter so that the suspension is not so long. Any suggestions? function Script:Start() --Create the vehicle chassis chassis = self.entity chassis:SetPosition(0,5,0) --Create the vehicle vehicle = Vehicle:Create(chassis) --Add tires local tireradius=0.35 local tiremass=100 local tirewidth=0.5 local tireheight=-0.35 local tirespacing=0.5 local damper =2.0 local damper2 = 500 local damper3 = 500 tiremodel={} tiremodel[0]=self.llanta1 tiremodel[0]:SetPosition(tirespacing,tireheight,0.9) vehicle:AddTire(tirespacing,tireheight,0.9,tiremass,tireradius,tirewidth,true) tiremodel[1]=self.llanta2 tiremodel[1]:SetScale(tireradius*2,tirewidth,tireradius*2) tiremodel[1]:SetPosition(-tirespacing,tireheight,0.9) vehicle:AddTire(-tirespacing,tireheight,0.9,tiremass,tireradius,tirewidth,true) tiremodel[2]=self.llanta3 tiremodel[2]:SetScale(tireradius*2,tirewidth,tireradius*2) tiremodel[2]:SetPosition(tirespacing,tireheight,-0.7) vehicle:AddTire(tirespacing,tireheight,-0.7,tiremass,tireradius,tirewidth,false) tiremodel[3]=self.llanta4 tiremodel[3]:SetScale(tireradius*2,tirewidth,tireradius*2) tiremodel[3]:SetPosition(-0.5,tireheight,-0.7) vehicle:AddTire(-tirespacing,tireheight,-0.7,tiremass,tireradius,tirewidth,false) --Add axles vehicle:AddAxle(0,1) vehicle:AddAxle(2,3) --Finalize the vehicle if vehicle:Build()==false then Debug:Error("Failed to build vehicle.") end --Start the engine vehicle:SetEngineRunning(true) --Release the emergency brake vehicle:SetHandBrakes(0) end 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted November 18, 2017 Share Posted November 18, 2017 Suspensionlength...all the little problems you are running into are actually kind of funny when you read the whole thread. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted November 18, 2017 Author Share Posted November 18, 2017 16 hours ago, Josh said: Suspensionlength...all the little problems you are running into are actually kind of funny when you read the whole thread. Hello, now what happens is that I have the vehicle that rebounds a lot, any suggestions? local damper = 10 local spring = 100 local dist = 0.001 montaCarga:AddTire( -ejePos, -ejeAlt, posZ, 10, radio, ancho, false, damper, spring, dist) montaCarga:AddTire( ejePos, -ejeAlt, posZ, 10, radio, ancho, false, damper, spring, dist) montaCarga:AddTire( -ejePos, -ejeAlt, -posZ+0.3, 10, radio, ancho,false, damper, spring, dist) montaCarga:AddTire( ejePos, -ejeAlt, -posZ+0.3, 10, radio, ancho,false, damper, spring, dist) Quote Link to comment Share on other sites More sharing options...
Josh Posted November 18, 2017 Share Posted November 18, 2017 Adjust the spring value. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Yue Posted November 18, 2017 Author Share Posted November 18, 2017 31 minutes ago, Josh said: Adjust the spring value. It wasn't working, so after testing I increased the mass of the tires and it's working. Another question, how do I establish the car's center of mass? Quote Link to comment Share on other sites More sharing options...
Josh Posted December 3, 2017 Share Posted December 3, 2017 You should not need to, it will work out the mass center itself, assuming uniform density. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.