Announcement

Collapse
No announcement yet.

How to use/write "GetComponentLocation" in c++

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Originally posted by TheJamsh View Post
    This is how you do it:
    Code:
    FVector Location = CompStart->GetComponentLocation();
    ---


    Primitive Component *does* have a location, it inherits from Scene Component.
    Thanks Jamsh, I read the documentation poorly. ><

    Leave a comment:


  • replied
    Originally posted by TheJamsh View Post
    This is how you do it:
    Code:
    FVector Location = CompStart->GetComponentLocation();
    ---


    Primitive Component *does* have a location, it inherits from Scene Component.
    Thanks! that did the trick

    And thanks to everyone else for the help!

    Leave a comment:


  • replied
    This is how you do it:
    Code:
    FVector Location = CompStart->GetComponentLocation();
    ---

    Originally posted by Telimaktar View Post
    PrimitiveComponent doesn't have location, SceneComponent does however, once you update your method signatures to SceneComponent you will have access to Startcomp->GetcomponentLocation()
    Primitive Component *does* have a location, it inherits from Scene Component.

    Leave a comment:


  • replied
    Side note: the first if condition is also bugged, it should read
    ​​​​​​
    if(!CompStart || !CompEnd)

    Leave a comment:


  • replied
    Use Startcomp->GetComponentLocation()


    Edit: removed the lies ><
    Last edited by Telimaktar; 10-08-2019, 01:53 AM.

    Leave a comment:


  • replied
    Hi! I'm very new to c++
    UPrimitiveComponent
    For this particular IntelliSense error, the fix is to add the header: #include "Components/PrimitiveComponent.h"

    Leave a comment:


  • started a topic How to use/write "GetComponentLocation" in c++

    How to use/write "GetComponentLocation" in c++

    Hello, I'm very new to c++. I'm trying to to get the world location of a Component but i keep getting a pointer error. I don't understand why i'm getting this error or what to do. I've tried multiple ways of writing it out but nothing works. I also went searching online for how to use "GetComponentLocation" but there is little to no help with any c++ code and the UE4 API doesn't help someone new like me at all. Its probably very simple fix. If someone out there could tell me what to do or write an example of using this function as it would only take a few minutes , Thanks!

    btw i was using: USceneComponent::GetComponentLocation

    Please refer to the image i've included
    Click image for larger version

Name:	Pointer..PNG
Views:	13
Size:	54.6 KB
ID:	1669984
Working...
X