Devlog 1: Adam Mashaw
Problem: Issues with Spawning Actors
It being a while since I have worked with Unreal's coding things, being more used to Unity's, I had gotten lost when it came to spawning the actors using code. I had made a testing project prior to getting revision control set up. I had created it to make a prototype of a grid system. I had made this in a blueprint version of the game. Once we had transitioned over to the real project that we were going to be working on for the next couple of months, I had to translate everything from my testing project to the real one. There are a lot of things in their blueprint side of things that 'just work' when it comes to spawning actors, that I had forgotten about, or not known fully.
Once I had actually gotten movement for the player set up, I started work on the grid system, translating the things that i had in the previous project. I looked in my previous school works to see if that would help me, but I didn't find much purchase. I spent a number of hours trying to debug why both my grid system and the actors that spawned weren't showing up. I eventually got the math down for the grid manager itself, realizing that I was casting to something incorrectly, I still couldn't figure out a way to spawn the actor.
Solution:
The solution for the grid manager not placing the grid down properly was simply because I had my math wrong. I had forgotten to cast something to account for an offset, making the whole thing integer math, truncating important data, but after casting what I needed to into a float, the whole thing ran as intended.
As for actually spawning and displaying an actor, that took me a bit longer to figure out the solution. In short when using the 'GetWorld()->SpawnActor<AGridCell>(Location, FRotator(), SpawnParams);' I forgot to add the TSubclassOf within the function, just giving me the base class of AGridCell, which didn't have any actual visual data applied to it. after realizing my mistake, I learned what exactly the TSubclassOf thing actually did, and applied that to my SpawnActor function.
Get Guardians of the Keep
Guardians of the Keep
Status | Prototype |
Author | Lilcoin |
Genre | Action, Role Playing |
Tags | Hack and Slash, Tower Defense |
More posts
- Version 0.1.156 days ago
- Version 0.1.057 days ago
- Devlog 3: Joshua Bray84 days ago
- Devlog 3: Adam Mashaw84 days ago
- Devlog 3: Nathan Thorpe84 days ago
- Devlog 2: Nathan Thorpe90 days ago
- Devlog 2: Adam Mashaw90 days ago
- Devlog 1: Joshua Bray97 days ago
- Devlog 1: Nathan Thorpe97 days ago
Leave a comment
Log in with itch.io to leave a comment.