Page 1 of 1
Change to another actor
Posted:
Tue Feb 01, 2011 8:46 pm
by ThaKid244
Hi. I have two main charcters, raphael and michael. The view usually sits on michael but i want it to where when i press the "2" key, it switches parent to raphael and centers the view on him. Can anyone help? thx
Re: Change to another actor
Posted:
Tue Feb 01, 2011 9:11 pm
by lcl
Do it like this:
Key down - 2 - script editor:
- Code: Select all
ChangeParent(...);
view.x = raphael.x - (view.width / 2);
view.y = raphael.y - (view.height / 2);
Re: Change to another actor
Posted:
Tue Feb 01, 2011 9:53 pm
by ThaKid244
Could you explain what that does so i dont just copy and paste and dont know whats going on? thx
Re: Change to another actor
Posted:
Tue Feb 01, 2011 10:02 pm
by schnellboot
- Code: Select all
ChangeParent(...); //change parent
view.x = raphael.x - (view.width / 2); //move view to raphael and center
view.y = raphael.y - (view.height / 2); //same as x ..
This is lcl's code commented.
Re: Change to another actor
Posted:
Tue Feb 01, 2011 10:08 pm
by ThaKid244
Okay thank you once again
Re: Change to another actor
Posted:
Tue Feb 01, 2011 10:13 pm
by schnellboot
again?
Re: Change to another actor
Posted:
Tue Feb 01, 2011 10:16 pm
by ThaKid244
haha yes im saying thank you again
Re: Change to another actor
Posted:
Wed Feb 02, 2011 2:46 am
by again
Thank you for thanking me.
Re: Change to another actor
Posted:
Wed Feb 02, 2011 5:12 am
by schnellboot
lol ..