x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Hide Head But Still Cast Shadow

I want to hide just the head of the 3rd person mesh but I still want the head to cast a shadow. I am trying to attach the camera to the body for a FPS but still be able to see your body.

 void AActionCharacter::ToggleCamera()
 {
     if (IsFirstPerson)
     {
         GetMesh()->UnHideBoneByName("head");
         FollowCamera->DetachFromComponent(FDetachmentTransformRules::KeepRelativeTransform);
         FollowCamera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName);
         FollowCamera->bUsePawnControlRotation = false;
         IsFirstPerson = false;
     }
     else
     {
         GetMesh()->HideBoneByName("head", EPhysBodyOp::PBO_None);
         FollowCamera->DetachFromComponent(FDetachmentTransformRules::KeepRelativeTransform);
         FollowCamera->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetIncludingScale, "Camera");
         FollowCamera->bUsePawnControlRotation = true;
         IsFirstPerson = true;
     }
 }

This basically works, but then my characters shadow looks like the headless horseman.

alt text

Product Version: UE 4.15
Tags:
screenshot (3).png (908.9 kB)
more ▼

asked Apr 05 '17 at 02:42 AM in C++ Programming

avatar image

Janyx
487 66 64 211

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi. Did you try OwnerNoSee option on your skeletal mesh component ? This sounds like it could solve the problem.

alt text

Let me know

ownernosee.jpg (22.7 kB)
more ▼

answered Apr 05 '17 at 09:31 AM

avatar image

hubacek.jakub
239 14 19 19

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question