#BoxCollider2D & Rigidbody2D not working as expected

1 messages · Page 1 of 1 (latest)

torn prism
#

I need a bit of help figuring out a small issue with what seems to be my understanding of 2D rigidbodies and box colliders...
Keep in mind that this project is for the currently ongoing Game Jam so i dont have all the time in the world to try new things... but i am always of course still open to listen.

I am making a 2D platformer puzzle game where the player needs to get from point A to point B to beat the level.
To get to point B, the player needs to play the level multiple times in different ways, each time the player playes the level, they can loop back to the start, this will also create a clone of the player which is the exact playthrough the player just did, see the attached video to see the concept in action.

I rewrote the recorder just now to record player inputs instead of player positions, this is so that the player also push around the current replayers (replayer is what i call a recorded player loop).
Now that that is all set up, i re-enabled the rigedbody on the replayer prefab again as it should not also be simulated with the inputs its using.

This is where the issue comes in.
The way it worked before, the replayer prefab had 2 child objects that each had their own 2D box collider, one with the "Ground" tag and the other with the "Wall" tag.
This system worked great for the player to be able to jump on the replayers and bump into them and so on.
But now that the rigidbody is turned on again to the replayer prefab, this doesnt seem to have any effect anymore and the player does not regain their jump when jumping on a replayer.

Does anyone have any idea on how i could go about solving this?
if this doesnt work or takes to long, ill have to go back to the system i used before and that would be a shame.
Let me know if you need any of my code for context.

tulip quarry
#

!code 👇 please share the code in a readable way

lilac pumiceBOT
torn prism
#

alright holdon

torn prism
tulip quarry
#

okay so the issue is that when a collider has a rigidbody parent, the Collision2D's transform and gameObject properties will actually point to the rigidbody. rather than using other.transform.tag you'd want to access other.collider which will point to the exact collider you are colliding with

torn prism
#

ah i thought it might be something like that

#

ill try that out and report back holdon

torn prism
#

how do i mark this as solved?

tulip quarry
#

i think you can right click the thread and edit the tags?