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"

C++ component identifier not found. Need Help.

I would like to create a floating component, but I keep getting this identifier not found error messege. How can I create or find this identifier? Note: the GetActor and SetActor are the ones related to this error.

 Super::TickComponent( DeltaTime, TickType, ThisTickFunction );
     FVector NewLocation = GetActorLocation();
     float DeltaHeight = (FMath::Sin(RunningTime + DeltaTime) - FMath::Sin(RunningTime));
     NewLocation.Z += DeltaHeight * 20.0f;       //Scale our height by a factor of 20
     RunningTime += DeltaTime;
     SetActorLocation(NewLocation);
     FRotator ActorRotation = GetActorRotation();
 
     ActorRotation.Yaw += 0.5;
 
     SetActorRotation(ActorRotation);
     // ...

 






 
Product Version: UE 4.12
Tags:
more ▼

asked Aug 06 '16 at 07:34 PM in C++ Programming

avatar image

guivmc
6 7 12 20

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

1 answer: sort voted first

If this is an ActorComponent it does not have a transform. Use GetOwner()->GetActorRotation() and GetOwner()->GetActorLocation() instead.

more ▼

answered Aug 07 '16 at 12:16 AM

avatar image

Shohei
1.1k 31 8 40

avatar image BrUnO XaVIeR Aug 07 '16 at 01:11 AM

Some types of components do have a transform however.

avatar image DennyR Aug 07 '16 at 01:13 AM

Yeah, SceneComponents do.

avatar image Shohei Aug 07 '16 at 01:18 AM

SceneComponents are ActorComponents, but the opposite is not true. ActorComponents are not SceneComponents, and most components that change the functionality of its owning actor should derive from ActorComponent if it does not need its own transform.

https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Actors/Components/#actorcomponents

The poster did not specify what their component is derived from, so I can only take a wild guess at the problem. If the GetActorX methods are missing then it is likely inheriting from ActorComponent.

(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