Jump to content
  • Advertisement
MarcusAseth

Crashed the Unreal engine, no idea why... x_x

This topic is 436 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, the class below is the only thing I messed with, is the player blueprint for the worm game, so the bug is 100% in the image below, problem is that I don't have the slightest idea of how to debug it x_x

Though if someone feels brave enough and wants to take a look, I have commented the section with what I think and hope my code is doing, but probably is not... :S

Basically my whole reasoning was this:

We start driving the "Head" of the worm, when we Hit a Pickup then we use its location to initialize a new StaticMesh and store it in the Array of StaticMeshes that represents the "body blocks" of the Worm, and of course the last element we added thus the last index is always the (new) "Head".

So to update the position my idea was that every index starting from 0 and except the last is set to the position of the index in front of it, and then the last index (the Head) moves in the direction of the key pressed (since it has no other block to follow).

Also we don't update position the turn we hit the pickup because the rest of the body don't move and the the new head is added where the pickup was.

I also put a poor quality video below so you see Unreal engine exploding xD  Blue is the Worm, green is the Pickup. By the way, also notice that the blocks of the body even though being added and showing up at the correct location, are not moving at all... :|

http://i.imgur.com/Ytaq2Yv.mp4

ImageLink

hvvaX9y.png

Edited by MarcusAseth

Share this post


Link to post
Share on other sites
Advertisement

UP: Ok, I think the crash might be a mistake, trying to access an invalid index in the array, and I also think I'm close to understand why my blocks are not moving :P

Share this post


Link to post
Share on other sites

Ok, works, turns out I wasn't understanding correctly what my TArray was storing and was giving me back, is an Array of pointers and I was replacing the pointers to the StaticMeshesComponent, I was slightly mislead by the documentation because the method Get says it returns a copy by Value so I got confused and messed up xD

Video below to prove it works, so I can go back to polish and finish it :P

http://i.imgur.com/gyeHJG1.mp4

Should make a mental note of taking a 1 hour break and try again after it instead of panicking and create a useless post x_x

Edited by MarcusAseth

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!