Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by 3run. 02/28/20 09:28
Editting
by peterhw. 02/27/20 15:20
PS1 texturing bubbling ?
by 3run. 02/27/20 13:36
enum case / if else
by danatrader. 02/27/20 00:07
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
9 registered members (3run, AndrewAMD, Zheka, FLD, Dalla, jenGs, smamax, Iglarion, txesmi), 963 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Emrah06, zac, DebraSteed, Ricard, Apollo1
18379 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,293
Hiporope and its pain
txesmi Online
Serious User
txesmi  Online
Serious User

Joined: Jun 2007
Posts: 1,293
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 | chip programmers | 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