Results 1 to 4 of 4
  1. #1

    Default LinkMesh problem

    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();
    }

  2. #2
    Boomshot
    Join Date
    Apr 2001
    Posts
    2,184

    Default

    Somwhow you spaned an actor with bVisible set true drawtype set to DT_Sprite and a default skin slot..., or some combo there of.
    "Mother, mother may I cry. Father will you
    teach me how to die the right way someday. I don't want a
    second chance to turn my stuttering reluctance into romance..."

  3. #3

    Default

    Well, you were right. I have another class that spawns and is associated with the pawn, that was never set to bHidden = True. I had become fixated on thinking the problem was caused by the new mesh, and overlooked something very simple. Thanks for the wake up!

  4. #4
    Boomshot
    Join Date
    Apr 2001
    Posts
    2,184

    Default

    It happens to all of us at one time or another
    "Mother, mother may I cry. Father will you
    teach me how to die the right way someday. I don't want a
    second chance to turn my stuttering reluctance into romance..."


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.