Jump to content

Vehicle break while teleporting


Recommended Posts

Posted

Hello,

I would like to make some garages with interiors so I made teleporters. The problem is when I teleport with a vehicle, it breaks and it take fire. If I teleport with a bike, I fall of it and the bike breaks.

The vehicles don't touch the ground after the teleporting.

What could be the problem with that ?

Posted

The freeze changes nothing.

Here is the script :

  
                if ( not veh ) then  
                    setElementDimension( player, getElementDimension( other ) ) 
                    setElementInterior( player, getElementInterior( other ) ) 
                    setCameraInterior( player, getElementInterior( other ) ) 
                    setElementPosition( player, getElementPosition( other ) ) 
                    setCameraTarget( player, player ) 
                else 
                    setVehicleFrozen( veh, true ) 
                    setElementDimension( player, getElementDimension( other ) ) 
                    setElementInterior( player, getElementInterior( other ) ) 
                    setCameraInterior( player, getElementInterior( other ) ) 
                    setElementPosition( player, getElementPosition( other ) ) 
                    setCameraTarget( player, player ) 
                    local x,y,z = getElementPosition (other) 
                    setElementDimension( veh, getElementDimension( other ) ) 
                    setElementInterior( veh, getElementInterior( other ) ) 
                    setElementPosition( veh, x,y,z+0.3 ) 
                    setTimer( setVehicleFrozen, 500, 1, veh, false ) 
                end 
  

  • Discord Moderators
Posted

its due to the collisions in the area you warp to is not loaded. Set camera matrix to look at it for say two seconds, and then warp.

  • Discord Moderators
Posted

setCameraMatrix (x, y, z + 4, x, y, z)

It'll look at your specified place, 4 units over it.

Posted

Hm.. I put setCameraMatrix ( player, x, y, z + 4, x, y, z) before

     
                setVehicleFrozen( veh, true ) 
                    setElementDimension( player, getElementDimension( other ) ) 
  

And my vehicle is damaged anyway.

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