No, what I said is that, as stated above by Richard Hinckley, without any USceneComponent in an Actor (ie. an empty Actor like AInfo) the Actor has no Location.
In this game, they did not say the remove all components, just that for optimization sake they remove the USceneComponent as RootComponent (with two children) to directly use the USpriteComponent as the RootComponent (having now only one child, the hit-box component)
Thanks, I think I just didn’t realize where USceneComponent sits in the inheritance hierarchy which made me sound very silly. Got it now, crystal clear. Thanks again.
Just wanted to hop in really quick and clarify about the components. Our tiles still have RootComponents, they’re just PaperSpriteComponents. We had briefly switched to using SceneComponents instead, so we could scale the PaperSpriteComponents without having to also change the CollisionComponent we added for the Gem Tiles. However, after we were investigating where our performance hits were, and trying to minimize the number of components registered at once, we swapped back to having PaperSpriteComponents as the RootComponent.
The reason you don’t see any Components added directly in the Tile header and source files is because we inherited directly from PaperSpriteActor, which comes with that PaperSpriteComponent already.
Hope that clears up any confusion about the Components there!
And, right after posting, just saw that SRombauts nailed it. Leaving this here for more details, just in case.
Yup - my brain didn’t care to consider that the class used for tiles is downstream in the class hierarchy from the USceneComponent which was the source of the confusion. Looking forward to the next version of Match 3 with the new UI!
Hi, Lauren,
Great job, this Match 3 project is just what I want for learning UE4! Here is a question about learning it:
Right now when I look into this project I don’t see any C++ code. On the contrary, all the materials about Unreal Match 3 is talking about C++ usage. Did I get it wrong? Or do I have to do something special to see the C++ code?
Thanks!
Lauren can do a much better job at explaining this but generally you didn’t get it wrong, a lot of the main gameplay is done in C++. If you launch Visual Studio from the editor with Match 3 loaded it should take you right there…
An actor with no scene components? Yes, that’s correct. Because the root component’s transform is what you get when you ask for the actor’s transform.
Yes, so if you call GetActorLocation() on an actor with no root component, you will get a zero vector back, because the function doesn’t have a way to indicate failure, and we didn’t want to crash or asse. The exact line of code is this:
The tiles all have root components, so they’re just being moved around like normal actors. We use SetActorLocation() and just put them wherever we want. What I was saying about making things more efficient was that we had a dummy USceneComponent at the root, which we used to make some things a little easier to keep straight, and we removed that component. The UPaperSpriteComponent that you are seeing (the actual image of the gem/bomb/stone) was then promoted to be the new root component.
I’m digging through this still and have a question:
I was wondering why you have a ‘Score’ variable in the Match3PlayerController when the score is handled in the Match3GameMode? I can’t seem to figure out why.
Is there a reason why Unreal Match3 doesn’t set portrait splash images for the iPad pro and Pro retina in the iOS section of Project settings?
I noticed that the TappyChicken also omitted the same splash image slots.
What happens if someone runs Match3 on one of those devices?
Cheers.
Btw,
I was going to attach an image for clarity, but the when I click [Insert Image] the usual ‘upload from computer’ option is missing. I only have an option to add a URL.