I need help . . . bad!

Hello everyone!

I’ve been doing fine in the course so far, but I’m stuck on several game breaking bugs that neither google or the API documentation have been able to help me with. Here’s my repo: https://github.com/brno32/04_BattleTank/tree/master/BattleTank/Source/BattleTank

Here are my issues:

  1. SetRootComponent() in Projectile.cpp doesn’t always work. It says I cannot pass a UStaticMeshComponent in; sometimes it compiles, sometimes it doesn’t.
  2. In Projectile.cpp, ExplosionForce seems to be behaving as a nullptr. As you can see I’ve protected it, but since it isn’t getting set, all of the code afterwards won’t work of course, and I cannot for the life of me see why.
  3. ExplosionForce inside of my blueprint has no details panel. Removing the component, recompiling, putting it back, and recompiling it fixes it until I run the game again. Is this related to the issue with the pointer having trouble being set?

As you can see my code is almost identical to Ben’s, so I’m confused as to why it doesn’t work. Surely it’s not just the fact I’m on 4.17? And btw, I cannot find SetRootComponent() mentioned anywhere in the documentation. If anyone could point me to it, that’d be great!

@DanM, I’ve seen you posting a lot and your comments are always helpful. If you have the time, I’d appreciate you pointing out whatever dumb mistake I’m making!

Yeah, no clue. Like you said, removing and readding it works then restarting the editor breaks it. I would suggest going to

answers.unrealengine.com

and posting this as a bug report.

Thanks! I just wanted to be certain it was a bug before making a report.

Any idea why SetRootComponent() is acting so funny, or why I can’t find the function in the documentation?

Dunno I just do RootComponent = Thing;

Docs for SetRootComponent is here

Privacy & Terms