Hi again forums! I am working on polishing and finishing up the first level of my first ever game Unfortunately, I’ve hit a hitch.
Previously, I had been using extractors in each of the objects that the player character can “pick up” to attach objects to the player (+ a small equation for the Y so it looked like it was sitting on his head). Unfortunately, I have had COUNTLESS issues with the extractors randomly breaking, choosing another object to pull from, or sending my player character flying across the map.
I then moved to global rules- thinking that if it kept changing where it wanted to pull the values from, then I would just force it to use the specifics. Unfortunately, the global values appear to always be “on” despite being attached to a switch that is not. The object is attached to the player from the beginning against their will vs picking it up using a button, which is not my end goal.
Finally, I’ve been expirementing with attachers, which is the strongest choice so far and works almost perfectly, but I have been running into a strange and specific issue. It seems their is either a duplicate player character on my map, or the attacher is for some odd reason creating a dupe whenever I go to “pick up” the object.
The player character’s doppleganger just shows up where the object is and responds the same way the original does- except now there are two of them, which is very confusing for my poor code. Any tips on what might work better for a system that allows the player to pick up objects? The objects can’t be solid since they need to pass through other things, the player needs to be able to pass by them, ect. Thank you in advance for any help and for reading my lengthy post!!
Don’t have a lot of time rn, but just from reading it here’s my initial thougths
Seems like the object was solid constantly trying to reach the player, causing to push the player, and then follow. Basically a feedback loop.
Also, there is a “Attach” behavior that you may want to look into. (EDIT: At the end of the post you discuss this)
All Globals of the selected type will output when the value is changed. So if “Player X” is set to 123, all “Player X” Globals will output. Make sure you have that switch inside the attached object after the output of the Global. If the switch if off, the output won’t go past it. I’m assuming you were only trying to get the value with the switch on, not preventing the value if the switch is off.
I don’t have time to properly test in the game rn. I’m not entirely sure what you mean by duplicating the players, either there is another one in the level or another player object is being spawned in.
You can set objects to be non-solid but still have collisions. That means things can pass through them, but they are still able to detect when the collide with something (and can also be detected by Proximity or Ray Casts).
Thank you so so much for your thorough response! You explained everything in a way that is very easy to understand and I really appreciate you touching on every part- it allows me to learn about certain rules/functions that I otherwise might not know about! I’m making myself laugh thinking about the poor ticket flying around the map trying to find the PC
As far as the attacher goes, I’ve had issues with it in other games as well so I think it ultimately comes back to me doing something incorrectly. I’ll play around with it later and see if I can figure out what I’m missing.
I think I’m going to try putting the global values behind a switch in the PC, than use a message to turn it on, since they have been the most reliable in the past. Thank you again for your help!