Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Grant, AndrewAMD, ozgur, Quad, TipmyPip), 29,980 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Move entity towards player (pan+tilt) #448518
02/09/15 06:57
02/09/15 06:57
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline OP
Member
CanadianDavid  Offline OP
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
I would like to move an object towards the player. The following works to adjust the pan of the object so that it moves in the player's direction:
Code:
vec_to_angle(my.pan,vec_diff(NULL,player.x,my.x));
c_move(me, vector(5 * time_step,0,0), nullvector, 0);

However, I can't quite seem to adjust the tilt so that the object also tilts towards the player as it moves forward. Any suggestions?

Re: Move entity towards player (pan+tilt) [Re: CanadianDavid] #448648
02/13/15 18:49
02/13/15 18:49
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
those code lines should move the entity towards the player. Any surrounding entity blocking the up and down movement? Missing IGNORE_PASSABLE or so?

Re: Move entity towards player (pan+tilt) [Re: txesmi] #448709
02/18/15 07:49
02/18/15 07:49
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline OP
Member
CanadianDavid  Offline OP
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
Hi, thanks for the hint. I found the problem was because I was modifying the entity's position after immediately creating it but applying vec_to_angle(...) too soon before the entity had been moved.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1