Setting scale of pawn in pawn's event graph scales all instances

I’m terrible at googling. Spent an hour trying to find out how to do …

I have a pawn BP that has a skeletal mesh and sphere.
In the pawn’s event graph I have :

  • player enters the sphere and pushes a button → parent skeletal mesh to player and timeline scale the skeletal mesh and sphere.

works perfect for the pawn BP whose sphere I entered.

There are multiple instances of pawn BP in the map, and none of their spheres overlap.
Despite that all the others that shouldn’t be affected instantly blink out of existence.
I’d expect them to not be affected at all.

I tried adding a scale variable to the pawn BP, initializing it in the construction script and event graph’s begin play before trying to interact with it. Unfortunately that fixed nothing.

Any help would be extremely appreciated. isht is driving me nuts.
btw i had same problem with a simple actor bp that had a static version of the same mesh…

, I have some questions that might help me help you…

  • How is your pawn BP determining that the character has entered their sphere and not one one of the other pawn’s spheres?
  • What exactly do you mean by “parent skeletal mesh to player”? Use specific object types and property names involved if you can to make it clearer to me what you’re doing.

Hey ! Thanks a lot for checking out for me.

  • Hmmm…I didn’t set up anything specific for that. I have a OnBegin/EndOverlap in the event graph of the pawn. Therein lies nothing that determines that specific trigger was entered. Maybe I should set a InTrigger bool for that?
  • I apologize for that. The way I worded it is way too vague… The player character BP has a “grabbox” box collision component. If the grabbox overlaps the pawn sphere component AND the user prresses a button, then I parent the skeletal mesh of the pawn to a socket on the skeletal mesh component of the player character. (It’s effectively an item pickup.)

Edit: Shoot sorry for wasting your time. Can I mark your comment as the answer or something? Checking whether a bool in the pawn BP was set before attempting to scale/parent its mesh fixed the problem.

Thank you very much !

I’d suggest just posting the solution you described above as an “answer” instead of a “comment” and then marking it as the correct answer. Glad to hear you found a solution!

@
Sorry for the late reply but I’ve run into the same kind of problem again.

May I ask how you’d recommend I determine that the character has entered their sphere and not one of the other pawn’s spheres?

My initial implementation of checking for appears it doesn’t work correctly unless I interact with a pawn until it can’t be interacted with anymore.

seems really complex, but it’s actually quite simple (I just worded it horribly.)

So there’s an object (pawn BP) in the game that has a skeletal mesh with a collision box parented to it.

If the player enters the box and pushes a specific button, it will scale down.
After the object has been scaled, if the player is in the box and pushes a different button the player will collect the object (right now I just delete it, and increase an integer variable in the player BP). The player cannot collect the object until it has been scaled.

Note: In the object (pawn) BP I check variables in the player (character) BP to see if the buttons are pressed before scaling and or incrementing the variable.

I was hoping there were some kind of checkbox to say “Self contain Instance” or something to that effect so I wouldn’t have 50 BPs all juggling the same variables.

Yes. Figuring out how to describe stuff is often the most challenging part. I think I understand what you’re going for. Here’s one approach that would work…

First, I don’t think you want your pickup objects to be Pawns. Pawns are used only when you want something that can be “possessed” to move around the world in response to either player control or AI. Instead, your pickups should probably be Actors. Making change is easy. Just open the BP for your pickup pawn, open the Class Settings view and change the “Parent Class” to “Actor”. (Making change will be important for the following steps to work!)

97179-screen+shot+2016-07-05+at+10.52.54+am.png

For the scaling & pickup functionality you want, I suggest you put that logic inside the pickup itself rather than inside your character BP. The collectible BP will enable itself for input whenever the player enters its collision box and disable itself when the player leaves. Here’s what the blueprint would look like…

I tested using the 3rd Person template. Here’s the result…

97201-collectible.gif

Let me know if any of needs further explaination or if it doesn’t work the way you’d like.

I should point out that with the blueprint above, the pickups will enable themselves for input any time ANYTHING enters their collision bounds, not just the player character. So could be improved by adding a specific check for whether it’s the player that has entered. But for ease of comprehension I’ve used the simpler version above. If you want details on how to check specifically for player character collision let me know.

Hello !
Wow, thanks a lot for !
I will use your super clear steps/example as a base and slightly modify it to fit my needs.

“Enabling the input only when the player enters the collision box” is great. It’ll make everything much cleaner than it is now.

I sincerely apologize for referring to the pawn as just an object. I actually do want the thing to move around. It isn’t using AI now, but it might in the future. If I were to keep “object” as a pawn, other than leaving the Parent Class as “Pawn” would there be something else I need to set in the pawn BP’s settings or event graph?

Regardless, I will go ahead and start fixing up the objects event graph as you so kindly described.

Thank you so much.

I set it up almost the same way, but for some reason the inputs aren’t firing.
Debug prints are firing appropriately when I enter and exit the box trigger, but while enabled, pressing E isn’t doing anything.

The main difference is that I set the scale on event tick because I want it to scale over a specific amount of time. Even so, it never seems to be hitting the first branch in the “Use” Input.

The input buttons seem good to me. I left them unchanged from how they were in the character blueprint. “E” is the “Use” input and “F” is the “PickUp” input.

Did you change your objects to inherit from “Actor” instead of “Pawn”? That’s important. If you leave them as Pawns they won’t accept input using the approach I’ve shown. And don’t worry, Actors can still move (if you’ve marked them as “Moveable”)…they just move by setting their location using either blueprint nodes or C++. Pawns can only be moved by the actual PlayerController or AIController (at least I think so).

Hello,
"Pawns can only be moved by the actual PlayerController or AIController (at least I think so). "

is interesting. I’ll do my best to remember . I find it a little strange that an actor would ignore inputs. I wonder why.

"Did you change your objects to inherit from “Actor” instead of “Pawn”? That’s important. "
I’m sorry to have you repeat yourself. You made it perfectly clear that that was required before. I never imagined failing to do would render inputs unusable.

I’ll change it to actor now and post back.
Thanks again!

Switching it to actor got the inputs recognized, but both of the objects are scaling when one of them is used. Their collision boxes do not overlap (i.e., the player is only in one collision box at a time).

Does it matter how you place the bp in the world?

I dragged and dropped the bp from the content browser into the world, and then Alt+LMBed the one placed in the world to create another one.

Edit: hmm, I guess that doesn’t matter. I dragged each one from the content browser and placed, yet they still both scale when only one is interacted with.

Edit: That’s weird. They both scale when one is interacted with. But picking one up doesn’t pick up the other. It’s almost perfect.

The scaling logic has only ever been in the, now Actor, BP’s event graph. But I I’ll double-check just to be sure.

Ah, I can’t use a static mesh. The object is actually a skeletal mesh (it’s got an animation). Let me see what happens if I swap it out with a different skeletal mesh.

Edit: Swapping it out with a different skeletal mesh didn’t fix the problem. I double-checked the logic in the object’s event graph and found the problem. I was scaling them based only on one condition, one that wasn’t being controlled/toggled within that event graph pawn’s BP. Removing it and replacing it with one that was fixed the problem.

Thank you so much for your time, . I extremely appreciate it!

In the example I created to test my solution (shown in the animated GIF) I did not encounter problem. Are you sure you don’t have any old scaling logic left in a blueprint somewhere from your earlier attempts? Do you experience the same unexpected behavior if you swap out your current static mesh for the standard cube component?