# Attempted to access vehicleBluePrint, but VehicleBluePrint is pending kill

**URL:** <https://forums.unrealengine.com/t/attempted-to-access-vehicleblueprint-but-vehicleblueprint-is-pending-kill/446549>\
**Category:** Blueprint\
**Tags:** vehicle-advanced-tem, unreal-engine, UE4, Blueprint, question\
**Created:** [April 3, 2019, 9:08pm UTC](https://forums.unrealengine.com/t/attempted-to-access-vehicleblueprint-but-vehicleblueprint-is-pending-kill/446549 "2019-04-03T21:08:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_055e181f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_055e181f](https://forums.unrealengine.com/u/anonymous_user_055e181f)\
**Post date:** [April 3, 2019, 9:08pm UTC](https://forums.unrealengine.com/t/attempted-to-access-vehicleblueprint-but-vehicleblueprint-is-pending-kill/446549/1 "2019-04-03T21:08:17Z")

</div>

Hi, Im new to UE4 and was following a tutorial from an older version of UE4 and have run into a problem when running the game. I get the error message seen within the MessageLog and have no idea how to fix it and would very much appreciate some help. If any more details are needed I can supply them.

image of cast nodes  
[Screenshot by Lightshot](http://prntscr.com/n75e2q) [Screenshot by Lightshot](http://prntscr.com/n75e7m) [Screenshot by Lightshot](http://prntscr.com/n75e9t)

Image of error

 ![273207-screenshot-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/5/0/45064e32db5f9b11b3de5f7d9dd3d281433ac2ea.png)

Image of script

 ![273208-screenshot-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/0/7/807ab3e2d5fb4b0bef8ab5c34d379dd9d72a1c4d.png)

Link to the tutorial I have been following - [BP Time Attack Racer: Lap Display & Respawn Handling | 07 | v4.8 Tutorial Series | Unreal Engine - YouTube](https://www.youtube.com/watch?v=gp92v_iVGSQ&list=PLZlv_N0_O1gYdhCvvMKGpCF6LCgBz9XeS&index=7)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Nebula\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nebula\_Games\_Inc](https://forums.unrealengine.com/u/Nebula_Games_Inc)\
**Post date:** [April 3, 2019, 10:02pm UTC](https://forums.unrealengine.com/t/attempted-to-access-vehicleblueprint-but-vehicleblueprint-is-pending-kill/446549/2 "2019-04-03T22:02:50Z")

</div>

Looks like a screen shot of the wrong node causing the error. Where is the cast node it is trying to pull a reference for that is null/pending kill?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_055e181f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_055e181f](https://forums.unrealengine.com/u/anonymous_user_055e181f)\
**Post date:** [April 3, 2019, 10:14pm UTC](https://forums.unrealengine.com/t/attempted-to-access-vehicleblueprint-but-vehicleblueprint-is-pending-kill/446549/3 "2019-04-03T22:14:13Z")

</div>

Do you mean the script for the VehicleAdvHud or something else? I dont quite understand what part of the code you would like to see

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_055e181f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_055e181f](https://forums.unrealengine.com/u/anonymous_user_055e181f)\
**Post date:** [April 3, 2019, 10:19pm UTC](https://forums.unrealengine.com/t/attempted-to-access-vehicleblueprint-but-vehicleblueprint-is-pending-kill/446549/4 "2019-04-03T22:19:19Z")

</div>

Actually I believe these are the cast nodes you are looking for

> **[Screenshot](https://prnt.sc/n75e2q)**
>
> Captured with Lightshot

> **[Screenshot](https://prnt.sc/n75e7m)**
>
> Captured with Lightshot

> **[Screenshot](https://prnt.sc/n75e9t)**
>
> Captured with Lightshot

---

<div class="post-metadata">

**Author:** ![Nebula\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nebula\_Games\_Inc](https://forums.unrealengine.com/u/Nebula_Games_Inc)\
**Post date:** [April 3, 2019, 11:14pm UTC](https://forums.unrealengine.com/t/attempted-to-access-vehicleblueprint-but-vehicleblueprint-is-pending-kill/446549/5 "2019-04-03T23:14:11Z")

</div>

Yea, either you are trying to cast before the vehicle exists or you are casting after the vehicle got destroyed or the vehicle is not a “pawn” or “character”. That would be the reasons for that error.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_055e181f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_055e181f](https://forums.unrealengine.com/u/anonymous_user_055e181f)\
**Post date:** [April 3, 2019, 11:59pm UTC](https://forums.unrealengine.com/t/attempted-to-access-vehicleblueprint-but-vehicleblueprint-is-pending-kill/446549/6 "2019-04-03T23:59:16Z")

</div>

How do I fix it?  
Is there some sort of delay function I can add in to cast after wards, or something were I can check if my vehicle gets casted after it is destroyed or a way to check if my vehicle is a pawn of a character?

---

<div class="post-metadata">

**Author:** ![Nebula\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nebula\_Games\_Inc](https://forums.unrealengine.com/u/Nebula_Games_Inc)\
**Post date:** [April 4, 2019, 2:03am UTC](https://forums.unrealengine.com/t/attempted-to-access-vehicleblueprint-but-vehicleblueprint-is-pending-kill/446549/7 "2019-04-04T02:03:46Z")

</div>

You can always use the “is valid” node right before trying to use that pawn reference. Make sure the pawn is valid first. \*\*Still not 100% sure that is the bad node either FYI. Also noticed you have another error with the controller ref in the 2nd image. So that must be an empty reference container and you never “set” the controller.

---

<div class="post-metadata">

**Author:** ![Nebula\_Games\_Inc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nebula\_Games\_Inc](https://forums.unrealengine.com/u/Nebula_Games_Inc)\
**Post date:** [April 4, 2019, 2:05am UTC](https://forums.unrealengine.com/t/attempted-to-access-vehicleblueprint-but-vehicleblueprint-is-pending-kill/446549/8 "2019-04-04T02:05:39Z")

</div>

I would recommend checking out video #1 and video #25 in this series. It explains how to properly cast and the other video shows you a bunch of ways to create references. Both of which seem to be issues here. Fixing it requires making proper references, setting the variables before using them, casting objects that inherit from the class you are trying to cast to etc. The link should help get you looking in the right direction.

https://www.youtube.com/embed/videoseries?list=PLyu-W38DvZhqByAoeva1jewB5s78zQHIy&wmode=transparent&rel=0&autohide=1&showinfo=1&enablejsapi=1
