• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Have a object be created in the view[Solved]

L

Lander

Guest
I want two objects to be created inside my view but they won't. I don't know what I did wrong?
Code:
Code:
bar1 = instance_create(view_wview[0]/2, view_hview[0]/3, ob_choose1);
bar2 = instance_create(view_wview[0]/2, (view_hview[0]/3)+32, ob_choose2);
 

FrostyCat

Redemption Seeker
You forgot to account for movement of the view away from (0, 0), add view_xview[0] to the x component and view_yview[0] to the y component.
 
L

Lander

Guest
You forgot to account for movement of the view away from (0, 0), add view_xview[0] to the x component and view_yview[0] to the y component.
Ok right I remember seeing both at some point while learning about views where were would I place the view_xview and view_yview like this?
Code:
bar1 = instance_create(view_xview[0] + view_wview[0]/2, view_yview[0] + view_hview[0]/2, ob_choose1);
bar2 = instance_create(view_xview[0] + view_wview[0]/2, view_yview[0] + view_hview[0]/2, ob_choose2);
 
Top