suriyun-production / mmorpg-kit-docs

This is document for MMORPG KIT project (https://www.assetstore.unity3d.com/#!/content/110188?aid=1100lGeN)
https://suriyun-production.github.io/mmorpg-kit-docs
49 stars 11 forks source link

Wrong exit position when leave Vehicle in MMO #2398

Closed moepi2k closed 5 months ago

moepi2k commented 5 months ago

i have an issue when exit Vehicle in MMO. i think it has something to do with the FindGroundPosition here: https://gyazo.com/f827568e2bc026f743ab986fb0cdf18b

In singleplayer it works fine but in MMO the Player spawn in terrain. i draw something to explain it from the side https://gyazo.com/b4a553a260ba567b2a3da86bcf40f678

the green cross is the exit transform. an in sp it find the correct groundposition (orange), but in MMO player spawn at purple cross. i put the exit transform to y 10 to test and eventhen the playerspawn in terrain

insthync commented 5 months ago

As I seen it has no difference between server and client codes, I guess Unity server build might have difference proceeding with client which is non-headless.

insthync commented 5 months ago

You should try to debug the position, check if it pass find ground position function or not, then tell me the info later.

moepi2k commented 5 months ago

Thought same, i will debug it today

moepi2k commented 5 months ago

ok added some logs, and even on server the groundposition is correct. but somehow the player still teleports under the terrain (server and client) i noticed its only with few vehicles. others are fine. i need to check why

moepi2k commented 5 months ago

p.s found the issue. its because the player seat.position.y is lower then the exit.position.y. any idea whats best solution in this case?

moepi2k commented 5 months ago

can you change VehicleEntity.cs:

public bool RemovePassenger(byte seatIndex) and public void RemoveAllPassengers() to virtual so we can override it in inherited class?

else we cant make our own methode since the interface always call the base class.

insthync commented 5 months ago

Yes, you can do it because you have the repo access

insthync commented 5 months ago

Then make a pull request, that is it

insthync commented 5 months ago

Why did you request for a repo accessibility if you are not going to try to use it to improve the project?

moepi2k commented 5 months ago

cool i do, just wanted to ask before. maybe im doing something wrong but i think it need to be virtual to use the interface in inherited methode.

also debuged yesterday the thing with exit vehicle and maybe u have another solution for the problem as i described above. if it would work then i dont need to make my own methode.

so i wanted to wait till ur answer before i make request

insthync commented 5 months ago

Don't have to ask, when you create a pull request, it is just like to ask me to applies the changes, so if you ask here it is like double asking.

moepi2k commented 5 months ago

ok perfect thanks for the info. so for the issue with exit vehicle when player.transform.position.y is lower than exit.transform.position.y do you have any idea? actually i dont know why it cause to that issue in mmo, since even the debug log shows the correct position but still spawn under terrain in this case.