# "Cast to" object

**URL:** <https://forums.unrealengine.com/t/cast-to-object/403114>\
**Category:** Blueprint\
**Tags:** cast-failed, unreal-engine, question, Blueprint\
**Created:** [August 28, 2017, 7:57pm UTC](https://forums.unrealengine.com/t/cast-to-object/403114 "2017-08-28T19:57:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ldragosl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ldragosl](https://forums.unrealengine.com/u/ldragosl)\
**Post date:** [August 28, 2017, 7:57pm UTC](https://forums.unrealengine.com/t/cast-to-object/403114/1 "2017-08-28T19:57:02Z")

</div>

What object should i use for this cast?

[https://postimg.org/image/7mrtpq9id/](https://postimg.org/image/7mrtpq9id/)

---

<div class="post-metadata">

**Author:** ![Ninjin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ninjin](https://forums.unrealengine.com/u/Ninjin)\
**Post date:** [August 28, 2017, 8:01pm UTC](https://forums.unrealengine.com/t/cast-to-object/403114/2 "2017-08-28T20:01:17Z")

</div>

You need a reference of your Car. But you are asking a pretty simple question about Casting, so I recommend watching this fantastic video about [Blueprint Communication](https://www.youtube.com/watch?v=EM_HYqQdToE)! \<3

---

<div class="post-metadata">

**Author:** ![VictorBurgos](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/victorburgos/32/1008648_2.png) [@VictorBurgos](https://forums.unrealengine.com/u/VictorBurgos)\
**Post date:** [August 28, 2017, 8:15pm UTC](https://forums.unrealengine.com/t/cast-to-object/403114/3 "2017-08-28T20:15:30Z")

</div>

If there is ONLY one car in this game, and you want to make it quick and easy. use GetAllActorsOfClass (get BP Class), then Get 0 from that array, and use that as the reference.

[https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/FindingActors/Blueprints/](https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/FindingActors/Blueprints/)

I would definitely consider this a “cheat” way to do it. But until you learn more about how to properly get references, this isn’t a bad way of doing it really. Definitely say you should watch the video @Ninjin linked though.

---

<div class="post-metadata">

**Author:** ![Ninjin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ninjin](https://forums.unrealengine.com/u/Ninjin)\
**Post date:** [September 3, 2017, 12:46am UTC](https://forums.unrealengine.com/t/cast-to-object/403114/4 "2017-09-03T00:46:51Z")

</div>

Are you still having troubles after watching the video? Would be great to hear if you solved it, otherwise don’t forget to

![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/d/0/2d01efef11ed62dd542296d02ae6ee798d67c414.png)
