Download

[Solved] Print character/actor location on screen

Hi! I am trying to send the the character location (x,y,z) via OSC to another program and have no idea how to get the character position. “Get actor location” and then splitting into the variables x, y,z doesn’t seem to work. I first tried printing the location varibales on screen before seending it out, didn’t work either - So I guess the error lies in the “Get actor loacation” function. Any idea on how to set it up properly?

GetActorLocation works fine, can you show your code?

Are you using that node inside the character BP?

The Get Actor Location node is what you need.

Could you show preciely what you’re doing, where you’re doing it and which actor’s location needs sending?

thanks for the fast reply! Basically I am doing the “Sending OSC bundles” example from this post:

It’s working, when I send 1 vvariable (x or y or z) on character movement, but sending the bundle won’t work.

I am using the example in the Level Blueprint, not character Blueprint. I tried charracter Blueprint, but it didn’t work there.

The thing is that this is not the case. If one component is working, all of them are.

I am using the example in the Level Blueprint, not character Blueprint. I tried charracter Blueprint, but it didn’t work there.

Could you show a single screenshot where you’re sending the bundle and it’s failing? I’m not familiar with OSC but sending data is sending data. The concepts are the same.

So this is my Blueprint. Sorry, I was wrong, I did implement it in ThirdPersonCharacter.

When I press play though, the OSC reeceiver device closes down without error and when I add a Print at the end of the bundle, it won’t print the position but the default “hello” string. When I use it without Bundle and without GetActorLocation but with randomFloat instead, it works fine. So my guess is either the Bundle part is wrong or the GetActorLocation,but maybe it’s the break Vector part?

Not sure what to say. Get Actor Location being wrong is rather unthinkable. You can actually print just that (the entire vector) to see that it works fine.

Can’t comment on the Bundle stuff - never used it. Sorry.

I first tried printing the location varibales on screen before seending it out, didn’t work either

Can you elaborate on that? What are you experiencing when you:

image

1 Like

Nothing happens. I get no output on screen

Right, se we’re dealing with something completely else here. Is this actor ticking - can you print just Hello on Tick?

Just to clarify:

This does not print, right?

1 Like

That works… it sends me the Actor location but no hello on screen.

Nothing happens. I get no output on screen

vs

That works… it sends me the Actor location but no hello on screen.

So what is really going on here?

So the location does indeed work then? Correct?

I connected the Event Tick wrong in the Bundle example?? I don’t need to use “Break Vector” and 3 times “GetActorLocation”?

I am confused xD

I’m even more confused because I’m hearing 2 contradicting things.

You say that you get no screen output from tick Printing only to follow up with that it works.

Perhaps the issue is with the data being received on the other end. Perhaps you’re sending -750 and the system expects absolute values only? What values are we working with on the other end?

Admittedly, I might be worst possible person to try to help you out with OSC ;p I can only reassure you that the issue is not with Get Actor Location or breaking its vector.

1 Like

I connected the Event Tick like you did in your example: That gives me the Actor Location but not the “hello” String

You’re either printing the location or hello. It prints what you feed into InString. We wanted to establish that Get Actor Location works, it does. And that the Tick ticks, it does.

Now onto the OCS which I know nothing about.

I’m assuming we’re parsing data on the other end - what values are you expecting to receive there?

  • are negative values fine?
  • is there a range you need to fit into
1 Like

The other end is “Pure Data” and it works with floats in the IEEE-754 32 bit floating point range. I don’t know what the lowest negative float value can be…but I guess -750 on the x variable should work.

Actually I think you are so far the best person to help me by ruling out, what’s not the error :slight_smile:

You previously said that it worked with random floats. What range were you feeding it then. Can you feed it fixed value? Would it work the way you expect?

Sorry couldn’t fit the “print string” part on the screenshot, but this basically worked. When I press E it prints random float number on screen and also in “Pure Data”. So this way of using OSC worked. My guess now is that the Bundle stuff won’t work.