- Home /
making a climbable boss in 2d
I am making a game with mechanics inspired by dragon dogma and i would need for the character to be able to hold onto a body part of an ennemy and follow its movements
I currently am doing it trough making the character a child of the body part but this force the character into following its rotations and stretching which is undesirable.
The ennemy would also need to be able to have collisions with the environnement but not the main character , is this even possible with rigidbodies or should i work with something else?
My code is in c sharp
Thank for your help
Answer by Snipe76 · Jan 28, 2019 at 04:49 PM
It is possible with rigidbodies.
what do you mean by its posible with rigidbodys? if you mean that is is posible to do it with unity physics system is true, but you didnt even give him a tip or a path on how to approach it.
He asked if its possible, I simply answered Yes. He didn't ask how.
Answer by xxmariofer · Jan 28, 2019 at 04:52 PM
Hello, you just need to set as gravity the vector from the player to the center of the nemy (or any of the parts llike an arm) of the enmy. also remember to remove the Y component ..
i may need an exemple in code of that, i am not very skilled with that yet
What exactly is giving you issues? You can use the oncollisionenter and if you are colliding with the enemy get a reference the enemy transform, change the player state to a onenemy collision or something like that, you can get the vector from player to the ememy with simple geometry vector 2 - vector1. Create a aux cector and remove the Y axis and you will have the enemy new gravity and you can set it to the rigidbody.
i think i understood enough to find my way around it, thank you
Your answer
Follow this Question
Related Questions
When moving with root motion, How can moving on moving platforms be achieved? 1 Answer
How to play animation once in Input.GetMouseButton 1 Answer
Climbing script 0 Answers
Immersive climbing system. 0 Answers
Elevator Script ? 2 Answers