Game getting freezed


#1

I followed Kento Techno Armory tutorial https://www.youtube.com/watch?v=MWSNQBOlnS4.
Everything work fine but when i hold space for few seconds, armory keep getting freezed( Krom and both Html5 get freeze.(can’t uplode file because of being new user).


#2

It could be some buffer issue.


#3

@MagicLord can you explain it? does it has to do with my code or is it bug in armory.(when i said armory keep getting freezed, i meant the game not blender . just to be clear)…


#4

try running C++ and seeing if the problem persists. js/krom input is messy.


#5

Yeah, the problem is there. This popup when game freeze

.


#6

It looks like it is physics getContacts function doing a nullpointer exception.


#7

Allrights thanks, i will check my code again and find out where did i go wrong…


#8

i don’t know what happening, here is my blend untitled.blend (640.7 KB)
and my haxe code:
Astroid.hx (371 Bytes)
Ammo.hx (2.0 KB)
PlayerController.hx (1.6 KB)


#9

My best guess is that object.remove() makes it such that the script itself is uncallable. If you move the script to be a scene one (under the scene tab), and reference object with Scene.active.getChild(“Ammo”); then the game no longer freezes in the console.


#10

Alright, I fixed it , I don’t know how it worked but the problem was my ammo speed was slower than the player speed so, when spawning ammo and at same time moving player forward it sort of spawn ammos near each other and then it lag for a second and than its freeze.I think the problem has to do with ammos colliding with each other


#11

Why wasting physic ressources on ammo item ?

Put ammo script for each item.
The script checks player distance, when the distance is below a value the player gets the ammo.


#12

But i need collosion for ammo to hit the astroid, or am i misunderstanding something here?


#13

I thaugh it was some item to add ammo to your inventory :sweat_smile: