Jump to content

Jazz

Members
  • Posts

    265
  • Joined

  • Last visited

Posts posted by Jazz

  1. My lua project was fine and I left it for a few weeks. Now when I load it up the vehicle's forward/reverse controls are reversed. Couldn't figure it out so I created a new project with just flat terrain and shadmar's prefab car. Reversed controls..

     

    Anyone else experiencing this or did I mess something up?

  2. Truck and Tires are rigid body/prop. Certain settings will crash it.

     

    Still trying to figure it out. Last vehicle I made the same way but forward/reverse work opposite of what they should.

    • Upvote 1
  3. Finally got it to work for me. Script never could find all the tires so I modified it very slightly. Changed code is in the section below. Sorry about the formatting, I just can't get it to display properly.

     

    --Build the vehicle
    self.vehicle = Vehicle:Create(self.entity)	
    for n=1,8, 2 do
    child[0] = self.entity:FindChild("tire"..tostring(n))
     child[1] = self.entity:FindChild("tire"..tostring(n+1))
     if child[0]~=nil and child[1]~=nil then
    for i=0,1 do
    box = self:CalculateTireSize(child[i])
    				 if box~=nil then
    tireradius = math.max(box.size.y,box.size.z)*0.5
    tirewidth = box.size.x
    						 tirepos = box.center + child[i]:GetPosition(false)
    						 self.vehicle:AddTire(tirepos.x,tirepos.y,tirepos.z,self.tiremass,tireradius,tirewidth,n<2)
    						 table.insert(self.tires,child[i])
    				 end
    		 end
    		 if n>0 then
    				 self.vehicle:AddAxle(self.vehicle:CountTires()-2,self.vehicle:CountTires()-1)
    		 end
     end
    end
    
    

     

    I used the pickup truck body prefab and added the tires manually, setting the truck's tire children like the attached image...

     

    Hope this helps someone

    Edit: forgot to mention the tires must be named tire1, tire2, etc.

    post-12583-0-01779800-1416180401_thumb.png

    • Upvote 3
×
×
  • Create New...