Casting to actors

hey guys! I was searching on internet, but haven’t found sny info about casting to actors. Tha main idea is: turret decides, which speed bullet should have and sets “speed” to another actor “bullet” . its easy to cast to main character through “get player character”, but what should I use to cast to an actor?

This may be helpful for you. First video is all about casting :slight_smile:

But basically you need a reference which you can get using an overlap event, “get all actors of class”, hit event, a direct reference if using the Level BP or creating a variable and then hard coding the reference if the actor is already present in the world you can select it in the editor details panel. Your issue isn’t “casting” per se it is getting the specific object reference you need.

@Nebula Games Inc

Little confused now. You can’t get the world location of something that doesn’t exist yet. You can set velocity on an object when you spawn it though. Just make the variable instance editable and expose on spawn (details panel) this way you give the bullet it’s velocity then spawn it

just making object variable “bullet” works with getting basic things, what anything has, like velocity or location, but not with getting variables or components. variable is an information of a specific actor “bullet” , but location is world’s. So I need to use “cast to bullet”, cause it hasnt spawned before i need it.