Jump to content

Smooth camera movement?


megaman54

Recommended Posts

Posted

What i'm trying to do is this: the camera moves in a interior from room to another when the user switches the GUI menu. So the camera must move and rotate in multiple directions.

Posted

For example:

Suppose I want to move an object X from place A to place B. Distance between both is 100 units. Okay?

Remember that "speed = distance/time"

If I want X to be moved to B in 5 seconds:

you must use onClientPreRender (or onClientRender, dunno which is better), and then set X's position relative to "100/fps" (fps may be around 30, if I'm right) from A to B (it's + math operation).

Posted

It was an idea. Actually I have no idea about the time that GTA uses xDDDD. But you can use 30 as your reference (give it more or less value), it will work anyway.

Posted
Attach it to an object and move the object. Update camera position by using the event onClientPreRender.

God, I was going to post that lol

Seriously, I thought "why not moveObject for camera?", /me remembers the objects and... Eureka lol

This can be used for rotation too; the last three arguments on moveObject aids that. You can also set your camera facing point from the direction with some useful functions in the wiki ;)

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