Jump to content

Fuego con colisión


Recommended Posts

Posted

Hola a todos , Estaba poniendole fuego en las ruedas a una moto y tengo el siguiente problema

cuando cambio de vehiculo las dos llamas de cada una de las ruedas quedan donde estaba la moto , y no desaparecen

Aparte de que las llamas tienen colisión lol xD  Acá lo que he venido intentando:

 

-----destruir fuego
function firedelete()
local attachedElements = getAttachedElements ( getPlayerOccupiedVehicle (getLocalPlayer()) ) --get all elements that are attached to the car 
    for ElementKey, ElementValue in ipairs ( attachedElements ) do--loop through all attached elements... 
        setElementCollisionsEnabled (ElementValue, false) -- ...and disable their collision         
    end 
end
addEventHandler ( "onVehicleExit", getRootElement(), firedelete )

 

 

Y Acá el codigo del fuego por si las dudas :

 

ya no se ni donde iria si en otra funcion o dentro de esta ya probé todo :/

local ccx,ccy,ccz,ccrx,ccry,ccrz= 0,1.6,0.1,0,0,0 ---fuego rueda adelante
local cccx,cccy,cccz,cccrx,cccry,cccrz= 0,-1.0,-0.1,0,0,-90   ---fuego ruesda atras


function vehiclefire(cmd) 
    local veh = getPedOccupiedVehicle ( localPlayer ) 
    firefront = createObject( 2021, 2,2,2) 
    fireback = createObject( 2021, 2,2,2)
    
    attachElements ( firefront, veh,  ccx,ccy,ccz,ccrx,ccry,ccrz) 
    attachElements ( fireback, veh,  cccx,cccy,cccz,cccrx,cccry,cccrz) if
    end    
end
  
addCommandHandler("fire", vehiclefire)

Posted

Bueno ya lo solucioné era una estupidez , solo tenia que cambiar la id del objeto por otro objeto sin colisión en el particle objects ahora me averguenza haber hecho este post xD  no pude eliminarlo lol xDD

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...