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"

Collision and Trace not working with an AActor extended Class

Hello, So I am very new to UE, so I am not really sure how a lot of this stuff works, or why it is not.

I have set up a "UsableObject" class to extend an AActor class. I have set it up, so that I can add a mesh to it and place it somewhere on my map, and then my player should be able to do a line trace, and it is looking at the object, you can use it. So I have a implemented line trace, using ECC_Pawn Channel.

Now from my understanding (I may be wrong) I do not have a few options: A) Create a custom trace channel that only my UsableObjects are a part of, and if my Object is in sight, then do X

B) Use a generic trace Channel then check if the traced object is of type UsableObject

I have already set up a version of B), but I feel like A) might be more efficient, although I have no clue how to implement it, which if there are any help with that, it would be great. But even the B) method, does not work, I am thinking it is because my UsableObject, does not have any collision. I am not sure why that is, here is my actor class with my attempt at an implementation of method A.

 #define USABLE ECollisionChannel::ECC_GameTraceChannel1
 // Sets default values
 AUsableItem::AUsableItem(const class FObjectInitializer& ObjectInitializer)
     : Super(ObjectInitializer)
      // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
     PrimaryActorTick.bCanEverTick = true;
     itemName = "Name";
     itemType = "Type";
     collidable = false;
     holdable = false;
     MeshComp = ObjectInitializer.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("Mesh"));
        MeshComp->SetCollisionResponseToChannel(USABLE, ECR_Block);

Any help? I have been working on this a while, and do not know how to continue.

Product Version: UE 4.9
more ▼

asked Oct 03 '15 at 05:04 AM in C++ Programming

avatar image

122 26 22 29

avatar image joelComberiati Oct 04 '15 at 05:49 AM

anyone can help me? I know this can be done...

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

1 answer: sort voted first

I forgot to create a physicsAsset, oops

more ▼

answered Oct 04 '15 at 07:52 PM

avatar image

122 26 22 29

(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