instances remain static after assigning a speed of 8 and direction of 90, why?

M

Mister Lorik

Guest
Hello Community
This beats me. I have converted a game from GM 1.4 to GM2. Game worked fine in GM1.4 but now all my instances that have speed assigned to them do not move! for example i shoot bullets they remain static on the screen. GM Support refuse to help even tho the bug appeared after importing the game.
Here is the coding used:
with (instance_create_layer(O_Ship.x-14, O_Ship.y-15, "Compatibility_Instances_Depth_-2", O_Shot)) {speed=8; direction=90;}

So bullet appears but does nothing. If i change speed to vspeed then it goes flying up the screen but why does speed not work?
I tested the variable by setting the score to speed of O_Shot and it says 8 so obviously the speed is registering. I have placed this coding in the Create event of O_Shot also and still does not move.
If I can just get my bullets moving then perhaps i can apply the fix to all my other instances that are now not moving.
Any ideas anyone?
Thank you to everyone and keep safe in these trying times.
 

Sabnock

Member
i assume there is is nothing in the Create event of O_shot that sets the speed to 0?

Other than that it is a puzzle but having not imported any project from 1.4 i am not sure how the comparability scripts work.
 

Yal

šŸ§ *penguin noises*
GMC Elder
Is the object using physics? If it is, it will ignore the normal movement system.
 
M

Mister Lorik

Guest
Hello, thank you for your replies.
I can confirm there are no create events - I even created a create event to set the speed to 8 - and still the instance remains still.
There are also no physics being used. All physics boxes are unchecked for all objects used in the game.
Mystery deepens?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Add a debug breakpoint to the line where you create the bullet, then run the game in debug mode and step through the code so you can see exactly what is happening. That should show you what the issue is.
 
M

Mister Lorik

Guest
I found the answer with the help of my partner. in GM1.4 i used a variable i created called global.speed (which was exceptable in there) but in GM 2 global.speed was causing the root of all evil. I changed all references to global.myspeed and problem resolved.
Thank you to all.
 
Top