Announcement

Collapse
No announcement yet.

How should you format a file path being referenced?

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

    How should you format a file path being referenced?

    I'm trying to use constructorHelpers FObjectFinder but I think I'm not giving my filepath correctly
    Here's my path:
    an image of the path to a mesh

    I've tried referencing it like this:
    Code:
    static ConstructorHelpers::FObjectFinder<UStaticMesh> CubeAsset(TEXT("Geometry/Meshes/1M_Cube.uasset"));
    and I just get an error saying it cant find the mesh I've given, I've also tried giving the full path, with forward slashes and backward slashes.

    Could anyone link me or explain to me how I should be formatting this?

    #2
    You can right click an asset and copy the reference path inside the editor. It'll give you the correct formatting - just take the portion of the string inside quotes.

    Comment


      #3
      Originally posted by scrcr0 View Post
      You can right click an asset and copy the reference path inside the editor. It'll give you the correct formatting - just take the portion of the string inside quotes.
      I've tried this when I gave the full path and it doesnt like it. Do you think I'm just using the function wrong?
      Here's how Im doing it:
      Click image for larger version  Name:	devenv_7y56y2CwSm.png Views:	0 Size:	39.0 KB ID:	1726623
      it runs fine but after compiling the editor brings this up:
      Click image for larger version  Name:	UE4Editor_eDhR81cYLM.png Views:	0 Size:	6.9 KB ID:	1726624

      Comment


        #4
        Oh. Are you copying that path from Windows Explorer? Do it in the Editor. Just right click on the asset in the Content Browser and hit 'Copy Reference Path'. The string will contain a bit of extra stuff you don't need. Just delete everything not in quotes.

        Once you have it in your code, it'll be easy to figure out the formatting for future.

        Comment


          #5
          Originally posted by scrcr0 View Post
          Oh. Are you copying that path from Windows Explorer? Do it in the Editor. Just right click on the asset in the Content Browser and hit 'Copy Reference Path'. The string will contain a bit of extra stuff you don't need. Just delete everything not in quotes.

          Once you have it in your code, it'll be easy to figure out the formatting for future.
          oh I was clicking copy file path not the reference option above, thank you thats stumped me for almost a week XD

          Comment

          Working...
          X