UE3 - UDK Mesh not showing.

  • 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.

jonybiskit

New Member
Nov 3, 2013
3
0
0
I am currently working on a student project in UDK which involves a third person camera. I am using an archetype for the pawn and the usual mesh assignment code. In the platformer gem on the UDN website this works fine. I can launch this in an earlier version of UDK and switch out the meshes in editor and it works just fine, but in my code although the pawn seeps to be spawning, because I can collide with BSP in level, I can not see my mesh. Help would be much apreciated.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Code or it didn't happen. ;)

Usually the pawn's collision and visuals are handled by different components. Collision is a hidden cylinder by default, while a SkeletalMeshComponent or StaticMeshComponent is responsible for the visuals. That mesh component must be added to the Components list and set as non-hidden. And it obviously needs a mesh and possible one or more skin materials.
 

jonybiskit

New Member
Nov 3, 2013
3
0
0
Code:
/**
 *	YRPawn
 *
 *	Creation date: 29/09/2013 21:01
 *	Copyright 2013, Connor
 */
class YRPawn extends Pawn;

//Scale of the Pawn
//var(Pawn) const float PScale;

//Dynamic light enviornment component to help speed up lighting calc for the pawn
var(Pawn) const DynamicLightEnvironmentComponent LightEnvironment;

//How fast a pawn turns
var(Pawn) const float TurnRate;
//Int which stores the desired yaw of the pawn for turning//constructor and stuff
var int DesiredYaw;
//Int which stores the current yaw of the pawn
var int CurrentYaw;
//Socket to use for atttaching weapons
var(Pawn) const Name WeaponSocketName;


simulated event PostBeginPlay()
{
          super.PostBeginPlay();

          //Set the desired and current yaw to the same as what the pawn spawned in
          DesiredYaw = Rotation.Yaw;
          CurrentYaw = Rotation.Yaw;
          `Log("pawn pawn pawnd");
}
/**
 * Called when the actor has finished initializing a skeletal mesh component's anim tree. This is usually a good
 * place to start grabbing anim nodes or skeletal controllers
 *
 * @param	SkelComp	Skeletal mesh component that has had its anim tree initialized.
 * @network				Server and client
 */
 //


 //Below we will be lerping the yaw of the pawn
 simulated function FaceRotation(Rotator NewRotation, float DeltaTime)
 {
           local Rotator FacingRotation;

           // set the desired yaw
           if (NewRotation.Yaw != 0)
           {
              //DesiredYaw = NewRotaion.Yaw;
           }

           // if the current yaw doesn't match the yaw that we are moving twards then start turning
           if (CurrentYaw != DesiredYaw)
           {
              CurrentYaw = Lerp(CurrentYaw, DesiredYaw, TurnRate * DeltaTime);
           }

           //Update the facing rotation
           FacingRotation.Pitch = 0;
           FacingRotation.Yaw = CurrentYaw;
           FacingRotation.Roll = 0;

           SetRotation(FacingRotation);

 }
 defaultproperties
 {

                  //Remove the sprite component because evidently we don't need it... i'llf igur eout why later
                  Components.Remove(Sprite)

                  // create a light environment for the pawn
                  Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
                        bSynthesizeSHLight=true
                        bIsCharacterLightEnvironment=true
                        bUseBooleanEnvironmentShadowing=false
                  End Object
                  Components.Add(MyLightEnvironment)
                  LightEnvironment=MyLightEnvironment

                  // Create a skeletal mesh component for the pawn so that we can SEE HIM
                  /*Begin Object Class=SkeletalMeshComponent Name=MySkeletalMeshComponent
                        bOwnerNoSee=false
                        bCacheAnimSequenceNodes=false
                        AlwaysLoadOnClient=true
                        AlwaysLoadOnServer=true
                        CastShadow=true//noir
                        BlockRigidBody=true//physics?
                        bUpdateSkelWhenNotRendered=false
                        bIgnoreControllersWhenNotRendered=true
                        bUpdateKinematicBonesFromAnimation=true
                        bCastDynamicShadow=true //so stylish ... actually we may want to turn this off
                        //RBChannel=RBCC_Untiteled3//notsure what this is tbh
                        RBCollideWithChannels=(Untitled3=true)
                        LightEnvironment=MyLightEnvironment
                        bOverrideAttachmentOwnerVisibility=true
                        bAcceptsDynamicDecals=false//maybe if we make some?
                        bHasPhysicsAssetInstance=true//actually we may not need this .. buti'll keep it for now
                        TickGroup=TG_PreAsyncWork
                        MinDistFactorForKinematicUpdate=0.2f//don't know..
                        bChartDistanceFactor=true
                        RBDominanceGroup=20
                        Scale=1.0f
                        bAllowAmbientOcclusion=false // shit hurts
                        bUseOnePassLightingOnTranslucency=true
                        bPerBoneMotionBlur=false// set to true in ref-code but that looks undesireable to me
                  EndObject
                  Mesh=MySkeletalMeshComponent
                  Components.Add(MySkeletalMeshComponent)*/

                  Begin Object Class=SkeletalMeshComponent Name=MySkeletalMeshComponent
                  //MySkeletalMeshComponent=SkeletalMesh'CH_LIAM_Cathode.Mesh.SK_CH_LIAM_Cathode'
                  bOwnerNoSee=false
		bCacheAnimSequenceNodes=false
		AlwaysLoadOnClient=true
		AlwaysLoadOnServer=true
		CastShadow=true
		BlockRigidBody=true
		bUpdateSkelWhenNotRendered=false
		bIgnoreControllersWhenNotRendered=true
		bUpdateKinematicBonesFromAnimation=true
		bCastDynamicShadow=true
		RBChannel=RBCC_Untitled3
		RBCollideWithChannels=(Untitled3=true)
		LightEnvironment=MyLightEnvironment
		bOverrideAttachmentOwnerVisibility=true
		bAcceptsDynamicDecals=false
		bHasPhysicsAssetInstance=true
		TickGroup=TG_PreAsyncWork
		MinDistFactorForKinematicUpdate=0.2f
		bChartDistanceFactor=true
		RBDominanceGroup=20
		Scale=1.f
		bAllowAmbientOcclusion=false
		bUseOnePassLightingOnTranslucency=true
		bPerBoneMotionBlur=true
		bEnableSoftBodySimulation=True
		bSoftBodyAwakeOnStartup=True
	End Object
	Mesh=MySkeletalMeshComponent
	Components.Add(MySkeletalMeshComponent)

	Physics=PHYS_Falling
    WalkingPhysics=PHYS_Walking


                  //this is where we will ad bCanPickupInventory=true if we use that for certain things later
 }

I am also now realizing that my `log is not working in the PostBeginPlay();
 
Last edited by a moderator: