I have the same issue of overlaping shadows with the pawn and a custom weapon that I made. I tried using bParentedShadow with no effect.
Code:
class MyPawn extends UTPawn;
simulated function PostBeginPlay()
{
super.PostBeginPlay();
SetThirdPersonCamera(true);
}
function Hidden(bool hide)
{
Mesh.SetHidden(hide);
if(Weapon!=none)
{
Weapon.SetHidden(hide);
}
}
simulated function FaceRotation(rotator NewRotation, float DeltaTime)
{
if (Normal(Acceleration)!=vect(0,0,0))
{
if ( Physics == PHYS_Ladder )
{
NewRotation = OnLadder.Walldir;
}
else if ( (Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
{
NewRotation.Pitch = 0;
}
NewRotation.Roll = Rotation.Roll;
if (NewRotation != Rotation)
{
//faz uma interpolação maluca que da oque possui, aonde quer chegar, o tempo e a velocidade. oque importa é que roda da maneira certa.
NewRotation = RInterpTo(Rotation,NewRotation,DeltaTime,10);
}
SetRotation(NewRotation);
}
Owner.SetLocation(Location);
}
DefaultProperties
{
//relevante<
Begin Object Name=WPawnSkeletalMeshComponent
SkeletalMesh=SkeletalMesh'CH_IronGuard_Male.Mesh.SK_CH_IronGuard_MaleA'
AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman_BaseMale'
AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_Human'
bCastHiddenShadow=true
End Object
bWeaponAttachmentVisible = FALSE
//relevante>
}
Code:
class MySword extends UTWeapon;
simulated function SetPosition(UDKPawn Holder)
{
local Vector socketPosition;
local Rotator socketRotation;
super.SetPosition(Holder);
Holder.mesh.GetSocketWorldLocationAndRotation('WeaponPoint',socketPosition,socketRotation,0);
SetLocation(socketPosition);
SetRotation(socketRotation);
}
DefaultProperties
{
Begin Object Class=AnimNodeSequence Name=MeshSequenceA
End Object
Begin Object name=FirstPersonMesh
DepthPriorityGroup=SDPG_World
bCastHiddenShadow=true
SkeletalMesh=SkeletalMesh'MyWeapons.MySword'
AnimSets(0)=AnimSet'MyWeapons.Mesh_006'
Animations=MeshSequenceA
CollideActors=false
AlwaysLoadOnClient=true
AlwaysLoadOnServer=true
bUpdateSkelWhenNotRendered=false
bIgnoreControllersWhenNotRendered=true
bOverrideAttachmentOwnerVisibility=true
bAcceptsDynamicDecals=FALSE
Rotation=(Pitch=5000,Yaw=0,Roll=4000)
Translation=(x=0,y=10,z=10)
End Object
bShadowParented=true;
begin object name=PickupMesh
SkeletalMesh=SkeletalMesh'MyWeapons.MySword'
Translation=(x=0,y=0,z=20)
Scale =1.5
end object
AttachmentClass=class'MySwordAttachment'
WeaponFireTypes(0)=EWFT_InstantHit
WeaponFireTypes(1)=EWFT_None
InstantHitDamage(0)=50
ShotCost(0)=0
AmmoCount=1
MaxAmmoCount=1
WeaponFireAnim(0)=sword
MuzzleFlashSocket=MF
WeaponRange=50
}
Code:
class MyController extends UDKPlayerController;
simulated function PostBeginPlay()
{
super.PostBeginPlay();
`log("post controller");
}
exec function Use()
{
local vector hitLoc, start, norm, end;
local Rotator POVrot;
local TraceHitInfo hitInfo;
local Actor traceHit;
GetPlayerViewPoint(start,POVrot);
end = start + vector(POVrot)* 600;
traceHit = trace(hitLoc, norm, end, start, true,, hitInfo,TRACEFLAG_Blocking);
Spawn(class'PhysicsItem',,,end,,,);
if (traceHit != none)
{
if(traceHit.Class == class 'PhysicsItem')
{
`log("meu item");
PhysicsItem(traceHit).Action();
}
else
{
`log("Hit: "$traceHit$" class: "$traceHit.class.outer.name$"."$traceHit.class);
`log("Location: "$hitLoc.X$","$hitLoc.Y$","$hitLoc.Z);
`log("Material: "$hitInfo.Material$" PhysMaterial: "$hitInfo.PhysMaterial);
`log("Component: "$hitInfo.HitComponent);
}
}
}
DefaultProperties
{
CameraClass=class'MyCameraSetup'//relevante
}
Code:
class MySwordAttachment extends UTWeaponAttachment;
DefaultProperties
{
Begin Object Name=SkeletalMeshComponent0
SkeletalMesh=SkeletalMesh'GDC_Materials.Meshes.SK_ExportSword2'
end object
bShadowParented=true
BaseBoneName=WeaponPoint
WeaponClass=class'MySword'
MuzzleFlashSocket=MF
}
Bookmarks