# Adding a vehicle to Lyra

**URL:** <https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [October 12, 2022, 4:46pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138 "2022-10-12T16:46:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tbunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tbunreal](https://forums.unrealengine.com/u/Tbunreal)\
**Post date:** [October 12, 2022, 4:46pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/1 "2022-10-12T16:46:39Z")

</div>

As someone with a very surface level understanding of lyra (adding custom weapons, animations and maps) how feasible would it be for me to add vehicles? Would I have to interact with a lot of server code to make this work? Where would I begin, is it worth trying?

---

<div class="post-metadata">

**Author:** ![IT\_NET11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IT\_NET11](https://forums.unrealengine.com/u/IT_NET11)\
**Post date:** [October 20, 2022, 11:03am UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/2 "2022-10-20T11:03:27Z")

</div>

This is my main goal in Lyra. Either posses a vehicle or another character. But it is not as simple as in ordinary UE.  
I am able to posses a vechicle and drive it around. But when I return to my Lyra character then input is frozen, I cannot move or look around.  
I am very interrested in the subject if anyone can hint me in the right direction.

---

<div class="post-metadata">

**Author:** ![Astaraa](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astaraa/32/1194560_2.png) [@Astaraa](https://forums.unrealengine.com/u/Astaraa)\
**Post date:** [November 24, 2022, 5:15am UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/3 "2022-11-24T05:15:18Z")

</div>

Update:  
Forwarding input from the character is the way to do it, rather than possession.

Possession isn’t necessary or ideal for a number of reasons.

---

<div class="post-metadata">

**Author:** ![IT\_NET11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IT\_NET11](https://forums.unrealengine.com/u/IT_NET11)\
**Post date:** [December 8, 2022, 12:13am UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/4 "2022-12-08T00:13:17Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/3/4/b34095443409620163709b0ced7f6884446fbbae.jpeg)

I saved the Lyra pawn as a variable and did a re-possess.  
The ingame debugging shows this debug info:  
Left is before possess. Right is after.

Left shows the avatar name, right dont show this.  
Left shows 11 grey GA\_, right shows same GA\_s but with status CantActivate

Maybe this can point someone in the right direction of how to repossed the Lyra Character after possessing a vehicle.

---

<div class="post-metadata">

**Author:** ![Linto\_Ibloxx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Linto\_Ibloxx](https://forums.unrealengine.com/u/Linto_Ibloxx)\
**Post date:** [December 19, 2022, 9:23am UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/5 "2022-12-19T09:23:35Z")

</div>

Hey, I am in a similar situation where I am unable to control my character once I exit my car. Can u pls elabprate the solution so that I can solve the issue? Any help will be really helpful.

---

<div class="post-metadata">

**Author:** ![Linto\_Ibloxx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Linto\_Ibloxx](https://forums.unrealengine.com/u/Linto_Ibloxx)\
**Post date:** [December 19, 2022, 9:23am UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/6 "2022-12-19T09:23:36Z")

</div>

Hey there, I am currently in a similar situation where I can drive through the map in my car. However, once I exit and possess my character, It’s frozen. Cant move or act. No inputs work. Im curious to know if you have figured out a way.

---

<div class="post-metadata">

**Author:** ![IT\_NET11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IT\_NET11](https://forums.unrealengine.com/u/IT_NET11)\
**Post date:** [December 20, 2022, 3:21pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/7 "2022-12-20T15:21:56Z")

</div>

> **[Join the UE/Lyra Dev Network Discord Server!](https://discord.com/invite/zRnXy8gC)**
>
> Check out the UE/Lyra Dev Network community on Discord - hang out with 156 other members and enjoy free voice and text chat.

---

<div class="post-metadata">

**Author:** ![Astaraa](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astaraa/32/1194560_2.png) [@Astaraa](https://forums.unrealengine.com/u/Astaraa)\
**Post date:** [December 21, 2022, 9:12pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/8 "2022-12-21T21:12:20Z")

</div>

Don’t use possession but forward inputs instead.  
On input event… if in vehicle, tell vehicle to do something.

---

<div class="post-metadata">

**Author:** ![schmozzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@schmozzz](https://forums.unrealengine.com/u/schmozzz)\
**Post date:** [December 22, 2022, 3:12pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/9 "2022-12-22T15:12:42Z")

</div>

does that work with multiplayer?

---

<div class="post-metadata">

**Author:** ![Astaraa](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astaraa/32/1194560_2.png) [@Astaraa](https://forums.unrealengine.com/u/Astaraa)\
**Post date:** [December 23, 2022, 10:08am UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/10 "2022-12-23T10:08:33Z")

</div>

That’s what I do because of multiplayer… Lyra specifically.  
I’m sure it’s what Fortnite does.

It becomes more to consider when you start thinking about damage and death for example.

---

<div class="post-metadata">

**Author:** ![Astrotronic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astrotronic/32/1194566_2.png) [@Astrotronic](https://forums.unrealengine.com/u/Astrotronic)\
**Post date:** [December 23, 2022, 5:11pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/11 "2022-12-23T17:11:03Z")

</div>

Hi all,

Astraa makes a good argument for using input forwarding, but in the context of possession I’m also stumped.

I added Chaos vehicles to Lyra. (remember to enable the chaos vehicles plugin) but am having similar input problems. Using this to Possess the vehicle works, but doing the same nodes in reverse (in vehicle BP) when trying to unpossess the vehicle / repossess B\_SimpleHeroPawn does not give me back walking pawn control. (As mentioned above)

 ![addvehiclelyra](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/0/ec053bf54a979c3379ae4290d3ea2e6fc7b384fb.png)

I guess the next step would be to figure out how to debug the enhanced input system. (What mapping contexts are active? Is my keypress being recognized?)

---

<div class="post-metadata">

**Author:** ![n00b\_013](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/n00b_013/32/631138_2.png) [@n00b\_013](https://forums.unrealengine.com/u/n00b_013)\
**Post date:** [December 30, 2022, 2:49pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/12 "2022-12-30T14:49:22Z")

</div>

The link is invalid/expired… Can you please send another? Would like to join the community…

Aside from that… Its crazy how little content is findable online to have lyra and vehicles combined…

Like, lyra ability to enter and drive the matrix vehicles with their destruction, would be such a nice combination…

---

<div class="post-metadata">

**Author:** ![IT\_NET11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IT\_NET11](https://forums.unrealengine.com/u/IT_NET11)\
**Post date:** [January 17, 2023, 5:47pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/13 "2023-01-17T17:47:49Z")

</div>

> **[Join the UE/Lyra Dev Network Discord Server!](https://discord.com/invite/JfXb4xVQx5)**
>
> Check out the UE/Lyra Dev Network community on Discord - hang out with 226 other members and enjoy free voice and text chat.

This link never expires and welcome 🙂

---

<div class="post-metadata">

**Author:** ![Fritz782](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fritz782](https://forums.unrealengine.com/u/Fritz782)\
**Post date:** [February 26, 2023, 10:08pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/14 "2023-02-26T22:08:44Z")

</div>

I really want to get this working in my game, could I see your blueprint? Thank you!

---

<div class="post-metadata">

**Author:** ![Fritz782](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fritz782](https://forums.unrealengine.com/u/Fritz782)\
**Post date:** [February 26, 2023, 10:09pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/15 "2023-02-26T22:09:10Z")

</div>

Hi did you ever get this working correctly?

---

<div class="post-metadata">

**Author:** ![Astaraa](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/astaraa/32/1194560_2.png) [@Astaraa](https://forums.unrealengine.com/u/Astaraa)\
**Post date:** [February 27, 2023, 7:38am UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/16 "2023-02-27T07:38:22Z")

</div>

What part are you stuck on?  
I want to make a guide. Just haven’t gotten to it yet.  
Here’s a working example: [Lyra // Chaos Vehicle // Unreal Engine 🚙💨 - YouTube](https://youtu.be/A9xOFB-LNE4)

---

<div class="post-metadata">

**Author:** ![nikohurst](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nikohurst](https://forums.unrealengine.com/u/nikohurst)\
**Post date:** [March 1, 2023, 8:03am UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/17 "2023-03-01T08:03:58Z")

</div>

Here’s how I did it

I added a variable inside the ALyraPlayerController class to record whether it is entering the carrier or not, and determine in the OnUnPossess method whether further processing should be done

The code is as follows.

```auto
void ALyraPlayerController::OnUnPossess()
{
	if (IsInVehicle == false)
	{
		// Make sure the pawn that is being unpossessed doesn't remain our ASC's avatar actor
		if (APawn* PawnBeingUnpossessed = GetPawn())
		{
			if (UAbilitySystemComponent* ASC = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(PlayerState))
			{
				if (ASC->GetAvatarActor() == PawnBeingUnpossessed)
				{
					ASC->SetAvatarActor(nullptr);
				}
			}
		}
	}
	
	Super::OnUnPossess();
}

```

Just save a variable of hero’s pawn inside the blueprint corresponding to the ALyraPlayerController, and you can use Possess to switch carriers

But there are still UMG and some other issues to deal with

---

<div class="post-metadata">

**Author:** ![xi57](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xi57/32/1194660_2.png) [@xi57](https://forums.unrealengine.com/u/xi57)\
**Post date:** [March 2, 2023, 3:23pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/18 "2023-03-02T15:23:10Z")

</div>

> [@nikohurst](#):
>
> But there are still UMG and some other issues to deal with

Lyra does things by default when you possess and unpossess, including executing Game Feature Actions that swap in/out widgets and Enhanced Input IMCs.

You’re on the right track.

---

<div class="post-metadata">

**Author:** ![Fritz782](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fritz782](https://forums.unrealengine.com/u/Fritz782)\
**Post date:** [March 4, 2023, 10:39pm UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/19 "2023-03-04T22:39:25Z")

</div>

all of it hahah.

---

<div class="post-metadata">

**Author:** ![nikohurst](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nikohurst](https://forums.unrealengine.com/u/nikohurst)\
**Post date:** [March 6, 2023, 8:13am UTC](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138/20 "2023-03-06T08:13:44Z")

</div>

Yes, the possess will also hide the character display in ULyraControllerComponent\_CharacterParts, I plan to change the way the character is displayed instead of ULyraControllerComponent\_CharacterParts, which involves more and more things 🙂

[Next page](https://forums.unrealengine.com/t/adding-a-vehicle-to-lyra/668138.md?page=2)
