I am having a minor problem with the LinkMesh function. I have searched everywhere for answers and poured through countless lines of code. So now I will ask the infinite intelligence that is the Unreal community for assistance.
Here's the deal. I want a player, at some point, to dynamically change his mesh. I set up an exec function, to call a function in my Pawn, that loads the new mesh and then calls LinkMesh. The new mesh shows up properly on my Pawn and works fine. However.... After that happens, a small birdhead is left behind floating in the air.
(If your not sure what I mean by birdhead, open UnrealEd, go to the texture browser, drop down to the Engine package, and look for the S_Actor texture.)
After much trial and error, my only guess is that the birdhead is the left over mesh from before I made the change. (e.g. if I am playing as Jakob, and use LinkMesh to change me to Brock, what happens to the instance of Jakob's Mesh.) Since meshes are not actors, I can't simply try to destroy it, if that's even what is being left behind.
I've looked through the existing UT2004 code and tried determining how they destroy meshes when a player dies, or when how they change a player to a skeleton (e.g. Lava Death), and can't see what they are doing different than me. I'll post some code below from my Pawn Class.
Code:class MyPawn extends XPawn; function ChangeMyMesh(); { local mesh MyMesh; MyMesh = Mesh(DynamicLoadObject(MyClass.default.MeshName, class'Mesh')); LinkMesh(MyMesh); AssignInitialPose(); }






Reply With Quote

Bookmarks