-
Vector Movement Question
Ok, I'm having a hard time controlling the vector movement with code. I dropped in the CT movement controller but still no luck... So I have an object that has vector movement, I'm using it as a projectile, I create it and it goes in whatever direction I set the vector to in the properties pallet. But I want to change the vector direction based upon my character's direction... So, I can test for my character's direction but I can't change the direction from 0 right to 180 left. I set the projectile to vector with gravity 2000 dir 0 intial's are 0 0 and move at start is not checked, animation dir is... but no combination allows me to change the dir to 180 or 'left'... So I put the movement controller in, set the object to my projectile, set everything for 180 degrees and the thing still goes right or 0 angle... the only way I can get it to move 180 is to set up the object intially moving at 180... Any idea how to program an object with vector movement to change direction? Thanks! I mean I could make another object and create it when my character is going in the other direction angle 180 and just create the vectored object that I need for each direction but that seems silly, there has to be a way to control a vectored object's direction at runtime... I tried before I put in the movement controller just making the object move in a dif. direction but that didn't change anything either... I also realize there is angle direction and movement direction and not entirely sure how the vector movement uses angles and not normal click directions but I suppose cause it's a vector object ;p
Thanks for any help!
-
Make sure you use the Set Object action, otherwise it won't know what object to deal with.
-
I did... the object needs to have vector movement to begin with right? Then set that object to the ct movement ext... and it should power it... doesn't do it... So no matter what my initial settings are on the object with vector mvmt I can't change them programatically...
-
1 Attachment(s)
You must be doing something wrong, could you upload an example? It works fine here:
-
I got it, I was creating new one's and not assigning them to the clickmovement extension after each creation, I just assigned it once at the start of the frame, not a good idea... so it needs to go like this:
Create Object with Vector mvmt and assign it as the object on that event, then I set a flag.
On flag reset flag, turn gravity vector to whatever direction I want and then Start the movement via the object, not the extension...
So I was creating objects and wanted to control each with the ext. object, have to assign it to each created object after it is created rather than the original object at the start of the page. Makes sense but wasn't obvious :-)
-
Thanks for the example btw, you rock!