Player pawn can't be teleport while jumping in the air

I try to teleport my player character while he dropping from the map I teleport him to the origin position.

my issue is my character can’t be teleport back to the original location while him in the air,and I can use any way to set the playercharacter’s location.

Hello,

I have been able to teleport my character back to the platform while falling off by using this setup:

Using this setup, when I press F, my character is teleported back to 0, 100, 0, which is the center of the platform, and 100 units up just to ensure I don’t end up stuck in the floor.

Let me know if there are any further questions.

I assuming I used same node ur did.(A Press event node and teleport node).my problem is I can teleport to the exact location while I walking on the ground.but when I drop down from the ground in air after 1s I can’t be teleported back to location on the ground.

How are you setting your Dest Location? Could you provide a screenshot?

alt text

It just happen in MultiPlayers’ game with server

Could you please provide screenshots of the blueprint that you are using to teleport your character? I’d like to see how you are setting it up. Thank you.

I think if u try to setup a multiple play game, it will happan

Have a look at this documentation for Networking with the Character Movement Component Character Movement Component | Unreal Engine Documentation
As you will see, there are different measures that need to be taken in account with the Character Movement Component when using it in a multiplayer game.

I followed the "Approach 4: CharacterMovementComponent Ability Implementation " which is you gave me tutorial but still not work.May I have a example about how to fix it?
I still try others’ way to fix it like following picture.

![75194-ts7(cpas$59f]}pq76cqp(m.png|1554x1003](upload://l4z4a65wU99Saa4iflwBQLBzu4b.png)

Looking over the documentation, I see that it requires overriding several code functions. Did you perform these overrides?

If so, would you mind sharing your code?

I just recreated a new ThirdPerson templete game. and my code is like following:

SCharacterMovementComponent.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "GameFramework/CharacterMovementComponent.h"
#include "SCharacterMovementComponent.generated.h"

UCLASS()
class MYPROJECT_API USCharacterMovementComponent : public UCharacterMovementComponent
{
	GENERATED_BODY()

	/** Unpack compressed flags from a saved move and set state accordingly. See FSavedMove_Character. */
	virtual void UpdateFromCompressedFlags(uint8 Flags) override;
};

/** Shared pointer for easy memory management of FSavedMove_Character, for accumulating and replaying network moves. */
typedef TSharedPtr<class FSSavedMove_Character> FSSavedMovePtr;

class FSNetworkPredictionData_Client_Character : public FNetworkPredictionData_Client_Character
{
	virtual FSavedMovePtr AllocateNewMove() override;
};

/** FSavedMove_Character represents a saved move on the client that has been sent to the server and might need to be played back. */
class MYPROJECT_API FSSavedMove_Character:public FSavedMove_Character
{
public:
	uint32 bPressedTeleport : 1;

	enum CompressedFlags
	{
		FLAG_JumpPressed = 0x01,	// Jump pressed
		FLAG_TeleportPressed = 0x03,	// Teleport pressed
		FLAG_WantsToCrouch = 0x02,	// Wants to crouch
		FLAG_Reserved_1 = 0x04,	// Reserved for future use
		FLAG_Reserved_2 = 0x08,	// Reserved for future use
								// Remaining bit masks are available for custom flags.
		FLAG_Custom_0 = 0x10,
		FLAG_Custom_1 = 0x20,
		FLAG_Custom_2 = 0x40,
		FLAG_Custom_3 = 0x80,
	};

	/** @returns a byte containing encoded special movement information (jumping, crouching, etc.)	 */
	virtual uint8 GetCompressedFlags() const;
};

SCharacterMovementComponent.cpp

// Fill out your copyright notice in the Description page of Project Settings.

#include "MyProject.h"
#include "MyProjectCharacter.h"
#include "SCharacterMovementComponent.h"

void USCharacterMovementComponent::UpdateFromCompressedFlags(uint8 Flags)
{
	Super::UpdateFromCompressedFlags(Flags);

	AMyProjectCharacter * MyProjectCharacter = Cast<AMyProjectCharacter>(CharacterOwner);
	if (!MyProjectCharacter)
	{
		return;
	}

	const bool bWasTeleporting = MyProjectCharacter->bPressedTeleport;
	MyProjectCharacter->bPressedTeleport = ((Flags & FSSavedMove_Character::FLAG_TeleportPressed) != 0);

	// Reset JumpKeyHoldTime when player presses Jump key on server as well.
	if (!bWasTeleporting && MyProjectCharacter->bPressedTeleport)
	{
		MyProjectCharacter->TeleportKeyHoldTime = 0.0f;
	}
}

FSavedMovePtr FSNetworkPredictionData_Client_Character::AllocateNewMove()
{
	return FSSavedMovePtr(new FSSavedMove_Character());
}

uint8 FSSavedMove_Character::GetCompressedFlags() const
{
	uint8 Result = 0;

	if (bPressedJump)
	{
		Result |= FLAG_JumpPressed;
	}
	
	if (bWantsToCrouch)
	{
		Result |= FLAG_WantsToCrouch;
	}

	if (bPressedTeleport)
	{
		Result |= FLAG_TeleportPressed;
	}

	return Result;
}

Does any easy way to set location and rotation for character in multiplayer game

Does any one know how to teleport character in multiplayer game? I am waiting for it

Hello,

I apologize for the delay, I was looking into this issue.

What you’ll need to do is setup your teleport mechanics on the server side instead of in the client. However, the teleport function itself has issues when it comes to replication, so consider using set actor location instead and seeing if that makes a difference in your setup.

Also, for your convenience, here is a link to our networking documentation: Networking and Multiplayer | Unreal Engine Documentation

If you run into any other issues while setting this up, go ahead and leaf through the documentation and see if you can find what you are looking for.

Have a great day

Thank u very much it worked for me