I have a main unit and instead of moving it I am going to move all the other units on the map. I have to take into account where my main unit would move to, reverse it, and take into account where the other units would move to, and somehow add these two movements together. Please take into account xyz.
This is my current idea:
reverse hero movement (unit point[x, y, z], distance[unit speed], angle[camera yaw]) = new point
other units movement (unit point[x, y, z], distance[unit speed], angle[whatever]) = new point
Take both "new points", add together, and divide = point between
Your saying when your player unit is moving you want the players unit to remain at the same postion, and the units or objects around it to actually be what is moving?
thats pretty simple math.....
you need to move the objects in the oposite direction that the player unit is intended to appear to be moving in.....
to actually figure alot of these values out is going to require some basic trigonometry
so Unit move a distance of 10 in an angled direction......... You need to get the x and y values of this movement.......
use trig to find x y values of appeared movement
apply reversed X and Y values to units that you really want to move
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Guess I'm still not explaining myself well enough.
My main unit is in the center of the map. When I tell it to move I used a trigger to stop it and move all the other units on the map instead in reserve to what my unit would have moved. That part isn't too hard. But the other units on the map also have their own movements, so I need to somehow add together the reverse of my unit and the movement of the other units. Individuality for each unit on the map.
I was thinking this might work, but I have to go put now and don't have time to test it:
reverse hero movement (unit point[x, y, z], distance[unit speed], angle[camera yaw]) = new point
other units movement (unit point[x, y, z], distance[unit speed], angle[whatever]) = new point
Take both "new points", add together, and divide = point between
Sorry I didn't reply for a while, life and work. I've tried following the steps you guys gave me but I can't seem to get it to work. Can you show me an example like how a trigger would look or a formula? Also, does movement vector refer to the new units position or the distance traveled?
I have no idea what to call it.
I have a main unit and instead of moving it I am going to move all the other units on the map. I have to take into account where my main unit would move to, reverse it, and take into account where the other units would move to, and somehow add these two movements together. Please take into account xyz.
This is my current idea: reverse hero movement (unit point[x, y, z], distance[unit speed], angle[camera yaw]) = new point other units movement (unit point[x, y, z], distance[unit speed], angle[whatever]) = new point Take both "new points", add together, and divide = point between
Any ideas?
Edit: I think i forgot some details, sorry.
Well, it is just the movement vector of your main unit reversed xD. If it moves (1,0.5,-1), the other units move (-1,-0.5,1) instead.
@zandose: Go
your post really doesnt make much sense
Your saying when your player unit is moving you want the players unit to remain at the same postion, and the units or objects around it to actually be what is moving?
thats pretty simple math.....
you need to move the objects in the oposite direction that the player unit is intended to appear to be moving in.....
to actually figure alot of these values out is going to require some basic trigonometry
so Unit move a distance of 10 in an angled direction......... You need to get the x and y values of this movement.......
Guess I'm still not explaining myself well enough.
My main unit is in the center of the map. When I tell it to move I used a trigger to stop it and move all the other units on the map instead in reserve to what my unit would have moved. That part isn't too hard. But the other units on the map also have their own movements, so I need to somehow add together the reverse of my unit and the movement of the other units. Individuality for each unit on the map.
I was thinking this might work, but I have to go put now and don't have time to test it:
Thats just basic vector addition, you take the movement vector of the other units and substract the theoretical movement vector of your own unit.
To get those vectors, use trigonometrics, like Soulcarver suggested.
Sorry I didn't reply for a while, life and work. I've tried following the steps you guys gave me but I can't seem to get it to work. Can you show me an example like how a trigger would look or a formula? Also, does movement vector refer to the new units position or the distance traveled?
Bump