Jump to content

Yue

Members
  • Posts

    2,291
  • Joined

  • Last visited

Blog Comments posted by Yue

  1.  

    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

     

  2.  

     

    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




     

    image.thumb.png.9bd2ab9c294bfef30605584482f10243.png

  3. 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. 

  4. 2 minutes ago, Charrua said:

    yes, for a tire you have to place the hinge at the same position of the tire (which is it's center also)

    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. 

  5. 30 minutes ago, Charrua said:

     

    
    bisagra = Joint:Hinge( 0, 0, 0, 0, 1, 0, self.puerta, self.entity )

    you are creating the joint at 0,0,0 so it will be at this position (bisagra = Joint:Hinge( 0, 0, 0, 0, 1, 0, self.puerta, self.entity )

    you have to place the hinge in the correct position, to the left of the door. If you decide to create the hinge by code, then, look on the editor whic are the x,y,z world coodinates at the left of the door and use these values on your code.

    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()

  6. 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()

     

     

     




     

  7. My point of view. I'm from Colombia, I have two products in Steam APP GAme Kit and Leadwerks, the way to access these products is through a third party that resells games in Colombia, he earns a commission and sends me the gift product in steam. Unfortunately I have no other payment options. 

×
×
  • Create New...