models position not global?

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
Paradan
Posts: 16
Joined: Wed May 18, 2011 5:45 pm

models position not global?

Post by Paradan »

hi, before I get to my question I'd just like to say thank you for making such an awesome program.


heres my problem, when I try to set a models position based off of the players model nothing happens unless I first put the playerModel.position.x(etc.) into a global variable.

I put a ZExpresion in the "satellite" models update with currentModel.position = playerModel.position it doesnt seem to work.

Is it supposed to be this way? It's easy enough to put globals in, but it feels redundant, and I think Im doing something wrong.
User avatar
Kjell
Posts: 1924
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Paradan,

If you're using only one Player model, you can simply read the Player.Position directly in the Satellite clones by spawning the Player as reference ( attached is a example of this setup ).

In case you're using multiple clones of your Player model, I recommend storing the "clone handle" that a Satellite should follow as a Variable ( type = Model ) in the Definitions node of a Satellite.

Don't hesitate to ask away if you have any more questions :)

Kjell
Attachments
Position.zgeproj
(1.42 KiB) Downloaded 468 times
Paradan
Posts: 16
Joined: Wed May 18, 2011 5:45 pm

Post by Paradan »

thnks for the reply, sorry it took so long to get back havent had time t work on this project til a few days ago.

switching from clone to reference solved my problem, I had switched everything to clones while trying to solve some transparency/blending issues.
Post Reply