How to get the location of a child tag from another class?


I’m trying to move the player to a component with a tag, the component is on another class, but instead of moving the player to it, the player moves to world location 0,0,0,
what am i doing wrong?

Choose up to 3:

  • you’ve misspelled the tag
  • there are no actors with such tag
  • there is 1 in a billion chance the average location is actually 0,0,0

I’m trying to move the player to a component with a tag

That’s not what you’re doing in the provided image. Wrong image?

no, that’s the right picture, I just don’t know what I’m doing apparently.

2 Likes

Can you tell us a bit more about what is supposed to be happening.

move the player to a component with a tag

  • how do you know which component you want to move to?
  • do you know which actor this component belongs to?
  • is there only one component / actor like this, ever?
  • does the script shown run in the player blueprint?

I want the player to spawn a object or class, whatever you call it, and that class has a child component, that I then want to move the player to.

  1. well the component has a tag, I expect that is enough?
  2. I don’t, I thought they just searched for all tags, so the actor wouldn’t really matter.
  3. yes just one.
  4. yes its in the players blueprint.

For starters, instead of components you’re getting actors. Instead of one you’re getting all.

Since you gave tag to a compoment rather than an actor, you’re getting none.


If in doubt, consider telling us what the overall scenario is. As in: Bob steps into a box and gets telerported away to a component in the scene.

the general idea is that, the player can spawn an actor that you can move with your mouse, but the player is constantly teleported to a child of that actor, if that makes any sense.

1 Like
  • if this is a spawned actor:

  • that is spawned like so in the Player BP:

the general idea

Somewhat cryptic but it could make sense, why not. Not sure where the need for tags kicks in, though. You already have the actor and its component available.


In case it was not clear, one can promote pins to variables of the correct type by right clicking pins:

It works for pretty much any data pin in the engine.

I’m not allowed to sit it?

The ref cannot be set in the editor because the actor has yet to be spawned. The reference is SET dynamically with the node. You’re doing fine.

don’t know why but nothing happens now, this is what i have.

Because you’re setting the spawned actor’s location, not the player’s - compare it with my pic.

the player can spawn an actor that you can move with your mouse

Where is your script for moving the spawned actor? I did not include it, hoping you got that going already. Perhaps you’re moving the sphere and then spawn the actor there?


I am assuming you want to spawn a Blackhole, place it somewhere and have the player who spawned it get sucked into it? It’s hard to guess how you need it to work. But this is what I got from reading the script / info you’ve posted.

sorry for making this more confusing than it needs to be, here is a picture of what the player should be able to do

1 Like

Yeah, cool diagram :sunglasses: . More complex than anticipated. Seems doable at a glance. So… how much of this have you got working? Is this 2d / 3d?


How does it rotate?

image

Like so? Because moments later it’s us who rotate around the point!

image

well spawn the black hole when I hold down shift, but cannot get player to rotate around it, that’s what that teleporting was for.

nono yes, its the player who has to rotate around the point

So… something like this mayhap?

Are we going in the right direction? What is supposed to happen to the camera while orbiting the thing?

1 Like

Uuhh YES, bus as an fps, you know retro style arcade game, so you fling yourself around the arena using the black holes.

I think the camera should stop at 90 degrees, as all fps do

Ah, so this is definitely not the right way to do it. I was rotating a vector. You’ll probably need physics of some sort for this. Lemme think, not sure if I find enough time today.

I feel like I should pay you at this point

no, as far as I know this don’t exist

Is there a visual reference to this? Any of those arcade games on YT? I’m pretty old but may not be retro enough to understand.

Would that be close to swinging on an imaginary rope if we replaced the rope with the gravitational pull of a black hole?