Native levels indeed the values are clobbered at. Did a bit of testing on this the last week.Post by PrinceOfFunky » Tue Oct 06, 2015 3:58 am
JackGriffin wrote:I'm not saying that actors would act like a charm if you change gravity, obviously a tentace couldn't spawn upside down, any other actor neither. But this is cause position, rotation etc are hardcoded inside Unreal Engine, if you want to spawn a tentacle upside down, you would need to create a new tentacle class that acts totally indipendent from the "physic" laws of UE.OK, now take it as a challenge. Can you make a tentacle that spawns upside down and works online? I briefly tried and I was very surprised at how hard it was to do.
Except if you want to try to force an actor to spawn upside down(obviously, without setting the mesh to be upsidedown), without re-creating its class, there you would need to add some "laws" or replace them or override them. And as you obviously know, these laws are hardcoded, sometime as native.
Pretty sure more than one of the native functions reset things.
Rotation.Pitch specifically.
The same values also get clobbered numerous places in the ScriptedPawn source, both in functions and
the state code. I tweaked every function that called SetRotation, and most of the ones that changed DesiredRotation.
No joy.
I was however able to get the thing to flip in some situations. PlayDying for one.
Here is a bit of code that will make that happen:
(I even added 2 comments to it, just for this post. )
Code: Select all
function PlayDying(name DamageType, vector HitLocation)
{
local Rotator newRot;
newRot = Rotation;
newRot.Pitch += 32768; // Pawn will flip 180 degree's from whatever Rotation it had when the function is called
// newRot.Pitch = 32768; // Pawn will land flat on surface
DesiredRotation = newRot;
SetRotation(newRot);
PlaySound(Die, SLOT_Talk, 4 * TransientSoundVolume);
PlayAnim('All', 0.125+(3.0 * FRand()), 0.1+FRand());
}
unless I had set DesiredRotation. (It would rotate em only about 90 degrees....)
Dunno if that is specific to tentacles, or ScriptedPawns or what, but thats what happened.
Should be releasing a working flying tentacle pawn soon, that will be upsidedown sometimes.
It will be using the above function. The PlayAnim makes em squirm upsidedown and cycle thru every
animation they can do at a random speed. It is cool.