nexal
Full vMember
Posts: 57
|
Post by nexal on May 21, 2020 13:32:32 GMT
Hi guys, as the title suggests using melee combat is there a way to stop the character if it encounters a wall or an obstacle instead of continuing to walk? Thanks
|
|
theyak
Junior vMember
Posts: 38
|
Post by theyak on May 22, 2020 1:18:42 GMT
Yes, In the layers set the object the character is colliding with to stop move layer
|
|
nexal
Full vMember
Posts: 57
|
Post by nexal on May 23, 2020 16:53:22 GMT
Yes, In the layers set the object the character is colliding with to stop move layer If you mean this, I tried but now the character sinks into the ground. Do you have any idea?
|
|
|
Post by rolfy on May 23, 2020 20:19:31 GMT
Not the player, set the wall or whatever object to StopMove layer as theyak suggests and it will work fine.
|
|
nexal
Full vMember
Posts: 57
|
Post by nexal on May 26, 2020 20:15:37 GMT
Not the player, set the wall or whatever object to StopMove layer as theyak suggests and it will work fine. Ok thanks I understand. But I have a single 3D of a building with the floor, I think that to do it first and not to touch the 3D it is better to create a vertical plane resting on the walls and put the one with the "stop move" layer, what do you say?
|
|
|
Post by rolfy on May 26, 2020 20:27:06 GMT
Not the player, set the wall or whatever object to StopMove layer as theyak suggests and it will work fine. Ok thanks I understand. But I have a single 3D of a building with the floor, I think that to do it first and not to touch the 3D it is better to create a vertical plane resting on the walls and put the one with the "stop move" layer, what do you say? If your building is enter-able and single mesh you could create an empty game object and put your colliders in that with it set to 'stopmove' layer. I would use box colliders so you do both interior and exterior walls at same time. If it is just a single wall you want then a plane would be just fine. You can use primitives with colliders and remove the mesh render component or add several collider components to single object whatever suits you.
|
|
nexal
Full vMember
Posts: 57
|
Post by nexal on May 30, 2020 8:52:29 GMT
Ok thank you very much I learned another thing ;-)
|
|