Jump to content

Help here Please.


Yue
 Share

Recommended Posts


There's something strange going on here. When I put a polymesh the force of gravity does not attract it even though it has 2000 mass. If I put another body type, if it's attracted to gravity.  Something strange is that it only happens in the rear of the vehicle in the front if it goes downwards, without any problem, gives the impression that automatically the center of gravity is in the front, and I don't know how to change that point of gravity to my needs.  

MC.png.8e4d4923bad52920d0f3c3c1c933094a.png

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

2 minutes ago, Yue said:


There's something strange going on here. When I put a polymesh the force of gravity does not attract it even though it has 2000 mass. If I put another body type, if it's attracted to gravity.  Something strange is that it only happens in the rear of the vehicle in the front if it goes downwards, without any problem, gives the impression that automatically the center of gravity is in the front, and I don't know how to change that point of gravity to my needs.  

MC.png.8e4d4923bad52920d0f3c3c1c933094a.png

Polymeshes do no move at all. Even with large mass. Use any option, but not polymesh when you want something to move.

  • Upvote 1
Link to comment
Share on other sites

13 hours ago, Yue said:

I'm thinking about the center of gravity mass of the vehicle, is there any way to modify that center? it looks like it's moving forward towards the engine of a normal car.

Can you post your model with an example?  I don't know why it is so front-heavy.

  • Thanks 1

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

I got it.

When I remove the vehicle script the model falls as expected.  So this is a problem in the vehicle system.  And since the vehicle system is being totally rewritten right now there is nothing to do at the moment but wait for 4.5.

Is the scene supposed to look like this in the editor or do I have a bug to hunt?  Why are the tires so far away?

screenshot115.thumb.jpg.60aa5fd916f12b400056e17accfd9765.jpg

 

  • Like 1
  • Upvote 1

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

19 minutes ago, Josh said:

I got it.

When I remove the vehicle script the model falls as expected.  So this is a problem in the vehicle system.  And since the vehicle system is being totally rewritten right now there is nothing to do at the moment but wait for 4.5.

Is the scene supposed to look like this in the editor or do I have a bug to hunt?  Why are the tires so far away?

screenshot115.thumb.jpg.60aa5fd916f12b400056e17accfd9765.jpg

 

Okay, I'll wait for version 4.5 :).

On the tires, I don't know if it's the right way to implement it, what I do is this.

I put on the scene the chassis, and then each tire where it belongs, then I assign the script to the chassis.  When this is done it is not displayed for fractions of a second that the tires run into place when the game is released.

If the rims are this far apart as shown in the picture, you can see that the tyres run to the chassis position, but it is usually very fast. I guess it's not a mistake, just to put the vehicle on the scene with their respective tires in place. 

Kind regards.

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

  • 1 month later...

Code Script Lua Vehicle.

 

script.llanta1 = nil --entity "Llanta 1"
Script.llanta2 = nil --entity "Llanta 2"
Script.llanta3 = nil --entity "Llanta 3"
Script.llanta4 = nil --entity "Llanta 4"


function Script:Start()
	

	
       InitVehiculo(self.entity)


end



function Script:UpdateWorld()
	
	

end



function Script:UpdatePhysics()


         
        self.llanta1:SetMatrix(montaCarga:GetTireMatrix(0))
		self.llanta2:SetMatrix(montaCarga:GetTireMatrix(1))
		self.llanta3:SetMatrix(montaCarga:GetTireMatrix(2))
		self.llanta4:SetMatrix(montaCarga:GetTireMatrix(3))
	
	if window:KeyHit(Key.A ) then

		self.entity:Translate( 0, 15, 0 )
		self.entity:SetRotation(0,-90, 0 )
	end 


	
end


function InitVehiculo( malla )

	montaCarga = Vehicle:Create( malla  )


	local ejePos = 0.6
	local ejeAlt = 0.3
	local posZ   = 1
	local radio  =  0.35
	local ancho  =  0.3



	montaCarga:AddTire( ejePos, -ejeAlt, posZ, 100, radio, ancho, false,200,       2000, 0.01)
	montaCarga:AddTire(  -ejePos,  -ejeAlt, posZ, 100, radio, ancho, false ,200,     2000, 0.01)
	montaCarga:AddTire( ejePos, -ejeAlt, -posZ+0.25 , 100, radio, ancho,false,200,	2000, 0.01)
	montaCarga:AddTire( -ejePos, -ejeAlt, -posZ+0.25 , 100, radio, ancho,false,200, 	2000, 0.01 )
	
	montaCarga:AddAxle(0,1)
    montaCarga:AddAxle(2,3)

	montaCarga:Build()
	montaCarga:SetEngineRunning( false  )
	montaCarga:SetHandBrakes(0)


end

 

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...