Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,528 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
entity following cursor's position #400606
05/04/12 15:00
05/04/12 15:00
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
Ok, I know it sounds simple, but I just didn't manage to make it. I want an entity which follows the mouse cursor, but its Z position must be always 0. (I need this to place 3d entities in my level using just the mouse)
here's what I tried, but the engine crashes or nothing happens:

action object()
{
VECTOR* temp;
while(1)
{
temp.x = mouse_pos.x;
temp.y = mouse_pos.y;
temp.z = 0;
vec_for_screen(temp,camera);
vec_set(me.x,temp.x);
wait(1);
}
}

Re: entity following cursor's position [Re: mEnTaL] #400612
05/04/12 17:05
05/04/12 17:05
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Vector *tmp needs to be vector temp ,learned this from evilsob


Compulsive compiler
Re: entity following cursor's position [Re: Wjbender] #400621
05/04/12 18:45
05/04/12 18:45
Joined: Jul 2009
Posts: 96
M
mEnTaL Offline OP
Junior Member
mEnTaL  Offline OP
Junior Member
M

Joined: Jul 2009
Posts: 96
I changed it to VECTOR temp and it doeasn't show an error now;
I also changed temp.z = 200 and it works.
Problem fixed. Thanks.

Last edited by mEnTaL; 05/04/12 18:59.

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