To address what the problem is, you are using + when you should be using -. Since the tank is supposed to be in the middle, then the view's position should be the tanks position minus half the view.
view -> Draw Actor -> Script Editor
- Code: Select all
x=tank.x-width*0.5;
y=tank.y-height*0.5;
And foleyjo, generally you don't want to use parenting like that. It does make the movement a tad easier since you don't need to write any code, but it can cause all sorts of other problems. For one, parenting actors will cause child actors to have a different coordinate grid, and also any states, colors, zdepth, transparency, and the like will be linked. Since you can avoid all of these problems from writing two easy lines of code, you should. A quick example where you'd get problems... You parent the view to the player. In your level you have parts that appear in front of the player, and some that appear behind (to create depth and so on). If you also have a hud that you parent to the view or the player, the graphics that should appear in front of the player, also appear in front of the hud, covering your health display and so on.