I’ve a Projectile C++ class which has these Collision properties:
The problem is that when I create a new Blueprint-Derived class from that class, I can’t resize my Collision Component.
I really really really need to resize that collision sphere, since in my game there are going to be many kinds of projectiles.
The CollisionComponent is declared in this way in the Projectile.h
It could be caused by RootComponent = CollisionComponent. When you place an Actor of the class in the editor the Location/Rotation/Scale you set in the details panel are actually Location/Rotation/Scale of the RootComponent (I think), same goes for dynamically spawned instances. What you should do instead is use a dummy SceneComponent (CreateDefaultSubobject, then RootComponent = SceneComponent). Then Create your CollisionComponent as you’ve shown above but replace the last line with CollisionComponent->AttachTo(SceneComponent) (or RootComponent if you’ve already assigned it). This should not only allow you to do what you want but it will also be much more flexible since it’s going to allow you to both independently set Location/Rotation/Scale on the CollisionComponent and any other Components attached to RootComponent but also to set Location/Rotation/Scale “globally” for the Actor through the RootComponents Location/Rotation/Scale.
Well, that’s kinda strange. I just tested almost all combinations of UPROPERTY() specifiers… and it just works on my side.
I have super simple test class: