Jump to content

Question


manve1

Recommended Posts

Posted

Is there a problem with setCameraTarget?

Because i tried it and it didn't set my camera to a vehicle which was created via server side

(( if u think i done something wrong, please post suggestion about how the script should look for the camera to be attached to a vehicle that was created via server side ))

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted

For what do you need the camera to follow a vehicle?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You'll need to make your own function, which will require maths if I'm right, to get the right position for the camera.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Race uses setCameraTarget with vehicle's driver.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

If you have any knowledge about math it should not be hard to get the position.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

If you have the position of the vehicle, the only functions you need are setCameraMatrix and Lua math functions ( may not be needed ) and the event onClientRender to update camera.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

I didn't remember that, use setTimer instead. I don't know if that's the most efficient way, though.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

Bad argument @ setCameraMatrix

local x, y, z = getElementPosition( source ) 
veh = createVehicle( 519, x + 15, y, z, 0, 0, 180 ) 
  
setTimer( 
function() 
if isElement(veh) then 
local xVeh, yVeh, zVeh = getElementPosition( veh ) 
setCameraMatrix( source, xVeh, yVeh, zVeh ) 
end 
end, 50, 0 
) 

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted

There is no source in your code.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

Source is not root. Just use the player element in the one you want to set camera matrix.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

You're welcome.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

Change Z Position.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

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