Page 1 of 1

xvelocity = view.xvelocity;

PostPosted: Sat Dec 31, 2011 4:52 am
by phyzix5761
view.xvelocity returns a value.

But when I try to assign view.xvelocity to an actor it does not return a value.

Code: Select all

xvelocity = view.xvelocity;



I have this in the actor's draw event. What am I doing wrong?

Re: xvelocity = view.xvelocity;

PostPosted: Sat Dec 31, 2011 6:50 am
by skydereign
You must be doing something else besides that. Attached is an example of similar code where it works. Perhaps you are setting an actor's variable via global code, like so.
Code: Select all
void
function ()
{
    actor.xvelocity = view.xvelocity;
}

In which case you have run into gE's global code actor variable problem. If that is the case, you can read up a little more on it here. http://game-editor.com/forum/viewtopic.php?f=2&t=10386&p=71270&#p71270

Re: xvelocity = view.xvelocity;

PostPosted: Sat Dec 31, 2011 7:10 am
by phyzix5761
Yep, I was setting the value via global code. It works now. Thank you.