When you use parent, it adds the parent's attributes to the child.
So when you move view to playerx and playery and also change view to become player's child, view is moving to twice the xy you intend.
A few suggestions:
1. Don't use events in a list like that, instead, on mousebuttonup, just have one event, script editor.
Using the variables/functions tab at the bottom of the script window, you can add all the events like normal, but they'll be inside the script window. Then you can edit all the events in one place, instead of having to choose them each off the menu each time you want to use them.
2. Don't parent view to player. Instead, use player>draw actor>
- Code: Select all
view.x=x-320;
view.y=y-240;
Then you won't have problems with where view moves to anymore. If you want to turn it on or off, create a global integer variable, and have this in the draw actor for player:
- Code: Select all
if(variable==1){
view.x=x-320;
view.y=y-240;
}
The variable will start on 0, so you can change it to 1 on newgame>mousebuttonup. In that case, you wouldn't even have to issue a view >moveto command, because player would start doing it the moment the variable became 1.