Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
digital12
16
Years of Service
User Offline
Joined: 15th Apr 2010
Location:
Posted: 15th Apr 2010 16:22
i cant get my camera to follow my object when i move it. I can only get my object to move on its own, someone please help...
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Apr 2010 18:35
Add this in your loop:


...substitute "obj" with your object number...

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 15th Apr 2010 19:10
There is a command "set camera to follow" or something like that. I think you still have to point the camera at the object though.

The fastest code is the code never written.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 15th Apr 2010 20:31
@Baxslash, be careful, MOVE CAMERA UP is a Matrix1Utils command that he may not have installed yet.

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 15th Apr 2010 23:11
Quote: "MOVE CAMERA UP is a Matrix1Utils command that he may not have installed yet"

I'm always forgetting which are plugins, sorry...

Replace:


...with:




Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 15th Apr 2010 23:31
From the help in DBP:

SET CAMERA TO FOLLOW
This command automatically controls the camera to provide a tracking system.

Syntax

SET CAMERA TO FOLLOW X, Y, Z, Angle, Distance, Height, Smooth, Collision

SET CAMERA TO FOLLOW Camera Number, X, Y, Z, Angle, Distance, Height, Smooth, Collision

Parameters

Camera Number

Integer
The camera number
X

Float
The x value of the target object
Y

Float
The y value of the target object
Z

Float
The z value of the target object
Angle

Float
The angle value of the target object
Distance

Float
The distance value specifies the required distance between the coordinate and the camera
Height

Float
The height value specifies the required height of the camera in 3D space
Smooth

Float
The smooth value specifies the level of smoothing required for the camera, where a value of 1.0 is no smoothing and a value of 100.0 is lots of smoothin
Collision

Integer
The collision value is a special flag that allows the camera to detect whether it is hitting any of the static collision boxes and if set to one will automatically adjust so as not to enter these collidable areas

Returns

This command does not return a value.

Description

By providing the 3D world coordinate of the entity you wish to track, and some camera data, your camera will automatically update its current position each time this command is called. The X, Y, Z and Angle values provide the coordinate to track. The Distance value specifies the required distance between the coordinate and the camera. The Height value specifies the required height of the camera in 3D space. The Smooth value specifies the level of smoothing required for the camera, where a value of 1.0 is no smoothing and a value of 100.0 is lots of smoothing. The Collision value is a special flag that allows the camera to detect whether it is hitting any of the static collision boxes and if set to one will automatically adjust so as not to enter these collidable areas

The fastest code is the code never written.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Apr 2010 00:15 Edited at: 16th Apr 2010 10:39
I use that one sometimes too...

Normally like this:


...if that helps!

EDIT: You have to manually set the angle each time your object turns too, something like this:


TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 17th Apr 2010 00:29 Edited at: 17th Apr 2010 00:29


TheComet

luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 17th Apr 2010 06:05
If you have Sparky`s colision plugin you can look at examples provided, there you can find something useful.In one of the examples there was camera following a sphere.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Apr 2010 15:54
http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

See tutorial 17 if you need any further info.

TDK

Login to post a reply

Server time is: 2026-07-26 07:36:40
Your offset time is: 2026-07-26 07:36:40