Hey guys,
I’m a straight up newbie when it comes to Unreal Engine, and game development in general. Have a history with Blender however, so I understand some of the technical junk with physics and whatnot. In that regard, physics in UE are destroying me right now.
Long story short - want to make a puzzle FPS that involves switching up gravity in order to pass each level - think a bit of spiritual influence to Portal’s Companion Cubes, except your character is not affected by the gravity - only the physics objects. As it stands, here’s what the overly simple blueprint for the cubes looks like:
Pretty straightforward. Gravity for cubes is disabled, physics are still enabled. At the start, the object is given the ability to receive input. There’s a vector for gravity. Pressing Q or E changes the direction of the pseudo-gravity vector. This vector is then added to an impulse that fires on every tick in order to simulate gravity. (I know there’s an issue with framerates with this method, this is just to test out the idea with the game)
Here’s the problem, however. Any time there are more than one of these objects, only the NEWEST object will work. I.E., We have gravityCube1 and gravityCube2. Only gravityCube2 will work. gravityCube1 is still a physics object, and can still be affected by the player/projectiles, but won’t react to the pseudo gravity, other than the initial setting to the negative gravity. As in, the first cube will still TAKE the original setting of the Gravity Rate vector in the photo, but won’t change vectors like the newer one will. If we have 100 cubes, only gravityCube100 will work. Not 1 through 99.
I’m just wondering how to fix this or bypass this. Again, I’m a newbie - any thorough explanation as to how/why it’s doing this would be greatly appreciated. Thanks in advance.