I have a setup where you press f, it draws a line trace, then sends a generic “interact” event to that object with the interacting player ref, as seen here
When set to run on server, nothing works for the client. When set to multicast, only setting the control rotation works for the client. All conditions work for the server.
Why is nothing triggering the set location for the client? I need the button to teleport the client and I want the code inside the button, not in the player character. What is the proper way to achieve this?
I use control rotation to control the direction that the character is facing, so my intended result is for the player to press the button, and be teleported to a specified location and facing a specified direction
Using this with multicast only changes the control rotation, not the location
I also need to set the scene component location for my games purposes, but that shouldn’t be why I’m experiencing issues as it doesn’t work with set actor location either.
the scene/root location is a child of the actor so that’s already set.
youre saying SetLocation doesnt work? is your actor replicated and replicating movement? keep in mind if you’re using the character movement component that may conflict but im pretty sure it has an inbuilt teleport function so try that?
also remember now the interact function is happening on the server so you may need to set control rotation on the OwningClient
My actor is replicating movement, I’m using the character movement component, and set actor location or set scene component location does not work. Using the teleport node does nothing, even on the server. Setting control rotation is the only part of this that’s actually working lol.
I am definitely not at 0,0,0, I tested in both multicast and run on server and neither worked, but now using runonserver causes my editor to crash as soon as I interact with the button on the client, but it works for the server. edit: I crashed it 10+ times trying to figure out why, so this is definitely the cause btw
Actually, I’ve been messing with this so long I forgot the chair is a child of another actor. Do you know what is causing this and how to get it working while being a child actor? Some relevant info is I am using the smooth sync plugin with the parent of the chair.
Edit: It does work when I drop in a new chair that is not a child, just weird that it doesn’t work as a child to me.
just to clarify when i say child, i mean the child actor component inside the other actor should be replicated too, although i’ve not done it this way myself so im getting outside my experience.
Here’s the replication settings of the chair inside the parent ship, which is also set to replicate.
Using child actors best solution I could come up with. I have a chair inside a space ship that has it’s own gravity, also a button that teleports players onto and off the ship, I’m unaware of any other way to achieve this than using child actors personally.
i think whats happening is the client has its own chair, so when it sends to the server ‘interact with this actor’ that actor doesn’t exist on the server hence crash.
try clearing the child actor and setting it on begin play server only.
alternatively instead of using a child actor you can spawn actor and attach it on server, or you can spawn a collision volume around the chair that handles the interaction.
So I decided to just skip child actors all together, is this the correct method of spawning and attaching? The execute pin is off begin play. Last question, thanks for all your help
looks right but remember only spawn on server so if its on BeginPlay put a SwitchHasAuthority before it.
it also may be better on the construction script so you can see it in editor
all that said though, this could be a bit awkward to place and position, try using box collisions, just put them over your chair, set them to block your interact trace channel and that’ll give you a transform to teleport too.
again ive not done this myself yet so just throwing out ideas