Announcement

Collapse
No announcement yet.

cant read position of actor-reference in my character blueprint

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

    cant read position of actor-reference in my character blueprint

    Hi,

    it should be a very simple task, but I am not able to ((

    Situation:
    I made a Character Blueprint. I added a variable of type actor->reference and made it public via "editable". I compiled and added a simple cube from the scene to it.

    I made this character blueprint my standart pawn Class in the project settings.

    Now I did it like in the picture:
    Click image for larger version

Name:	unreal4_reference_problem_01.PNG
Views:	1
Size:	80.5 KB
ID:	1216497

    So, when I play the level in "selected viewport" mode and press "P" I always got position 0,0,0 .

    Click image for larger version

Name:	unreal4_reference_problem_04.PNG
Views:	1
Size:	3.3 KB
ID:	1216500

    When I stop playback I got an error message too, that means translated, "it cant read the reference".


    Click image for larger version

Name:	unreal4_reference_problem_05.PNG
Views:	1
Size:	101.3 KB
ID:	1216501


    Thats why it is 0,0,0. When I then connect the "print string" with the "event tick", it prints me out again the 0,0,0 position, but next it prints me the right value of the reference.

    Click image for larger version

Name:	unreal4_reference_problem_02.PNG
Views:	1
Size:	79.2 KB
ID:	1216498

    Super interesting is, that when I now play the scene in "simulate" modus, it always prints me the right position of the reference, without toggling with 0,0,0 .

    Click image for larger version

Name:	unreal4_reference_problem_03.PNG
Views:	1
Size:	62.9 KB
ID:	1216499

    What do I do wrong?

    #2
    You're probably not possessing the pawn when starting the game so another one is created. You should be able to see this in the world outlier. The one in the level works because it has the variable, the one that spawns doesn't have the variable set to anything. You need to set the BP to auto possess for player 0 somewhere in the BP detail settings.

    Comment


      #3
      You made a variable called Player Start, but doesn't have anything in it. You may need to either drop the actor that has that code in your level, then use the eye dropper tool to select the actor to follow, and it will work.

      Or use a GetAllActorsOfClass node to get the actor you want to read from, and then asign the actor it returns to your variable on BeginPlay.
      Musical Range VR | Musical Range Trailer | Pausing Game On Steam Overlay | Aperture Tag

      Comment

      Working...
      X