How can I change actor size in OnInput function in [BullCowGame]?

Just finished the Bull Cow Game section of the C++ course, and wanted to make it a bit sillier so that losing lives made the cow actors on either side of the terminal a little bit bigger.

This is my first project in Unreal and only the second project in c++ (if you count the TripleX command line game) so I’ve got no idea what to do with the syntax. I’ve done a little bit of work with Unity in C# to have some intuition about how the process should go -

  1. Somehow pass a reference of the StaticMeshActor of the cows to the BullCowCartridge.cpp class
  2. Get the Transform component of the actors
  3. Call some setter function for its scale value that gets the current scaleX, scaleY, and scaleZ and then modifies them directly in the setter function signature.

It would be convenient if there were a way to expose a public variable like in Unity and then just select the cow actors from a drop down menu, but I could see there being a search function across the actors in the scene for the ones with the matching name tags or something.

I’ve been trying to google stuff like “change actor size with player input” but the stuff I can understand doesn’t seem relevant, and a lot of the rest is going over my head.

Is this just way too far outside the scope of the class so far? Or can someone give me a nudge in the right direction?

Hi @Keegan_Anderson,

If I remember correctly, the topic you mention about getting StaticMeshActor, and then performing some action on this objects is covered in next section of this course - Building Escape. I think you will find answers there as it is focused more on interacting with objects in Unreal etc. I think that it will be a great idea to start this next section, but when you learn how to interact with actors - go back to Bull Cow Game and apply this knowledge here! It will be a great practice! ( not only following step by step with course, but using knowledge with your current problems and ideas) :slight_smile:

That’s good to hear! I saw that the next section was still under re-development for 4.22 so I paused where I was, but I might try to just get caught up with what’s available and see if they’ve gotten back to that part yet. Thanks Barterbly!

Yes, there is a new version in development, but you can still access old version:

I did not see newer version yet, so I can’t tell differences for now, but I’m 95% sure that you will find answers for your case in original version of Building Escape, so give it a try! :wink:

Privacy & Terms