Scaling Spawn according to ColHeight and DrawScale

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

JamesKilton

UA Coder
Oct 6, 2002
210
0
0
Everywhere and Nowhere
Visit site
This is driving me nuts. For some reason, I cannot figure out how to get a structure to spawn on the terrain (not floating or buried) no matter what the DrawScale is. And yes, I've tried:

SpawnLoc.Z += StructToBuild.default.CollisionHeight * StructToBuild.default.DrawScale;

but with that the structure is almost always floating in the air. Thanx for the help.
 

JamesKilton

UA Coder
Oct 6, 2002
210
0
0
Everywhere and Nowhere
Visit site
Unless you make it scale. At PostBeginPlay of the structure, I call

SetCollisionSize(CollisionRadius * DrawScale, CollisionHeight * DrawScale);

To make sure the ColHeight and Radius change accordingly (very important as that's what draws the selection boxes).
 

Mychaeel

New Member
JamesKilton, why are you using that term from the first posting then instead of just using the current actual CollisionHeight?

Can you solve your problem by choosing a different Default.CollisionHeight for your actors?

EvilDrWong said:
perhaps thats just an example youve got up there, so excuse me if this doesnt apply, but most models are centered. try adding only half of the collisionheight to its Z

CollisionHeight is already half of the total height of the collision cylinder.
 

JamesKilton

UA Coder
Oct 6, 2002
210
0
0
Everywhere and Nowhere
Visit site
well, the current actual CollisionHeight doesn't take effect until the structure actually spawns, so that's why I have what I have in the topic. I have to take into account the change that will happen. Heck, I might just make the structures fall to the ground for now. What an annoying problem.