I have some characters and some vehicles. Whenever I try to attach my character to a vehicle on the client, the physics starts going crazy. I tried disabling collision and setting the movement mode on the character movement component (causes some issues apparently), but I’m still getting the crazy physics. It works just fine on the server, and even works on the client if I don’t attach the character to the vehicle.
FYI the vehicle mesh component is set to NOT replicate because I wanted the client to have more authority over it’s movement.
I honestly have no idea, but perhaps try changing the mesh to something else to make sure that it’s not the mesh and/or its physics that’s the issue. If you can drive a plain-old cube, then it is definitely the mesh. If the cube behaves the same way, then it’s almost definitely your code.
Also, I assume you’ve played with turning the physics on and off (assuming that the vehicle doesn’t require physics to operate.)
Tried changing the mesh to a default cube. Unfortunately, same issue .
Also the vehicle does operate off of the engine’s built-in physics. To me, this seems like some sort of physics-prediction issue (where it’s assuming it collides with the player pawn despite it’s disabled collision), but if it is, I have no idea how to adjust it to work properly.
Yeah, if a cube is behaving the same way, that means that there’s something wrong with the code. Whether it is your code or native Unreal code, I, unfortunately, do not know.
Were I you, I would create a completely new blueprint and see if I can successfully possess simple objects before adding all of the complicated stuff.
There could also be a box you need to tick, but, there are SOOO many boxes, so I would try to do the former:
Well, as I noted the only real issue is with AttachActorToComponent and SetCollisionEnabled. Possessing and everything works as intended. It’s just that if the capsule component is inside the vehicle mesh, everything goes crazy. Here’s the same exact code except with a location offset added so the actor resides a bit higher (not intersecting with the vehicle mesh).
I was asking if you were able to possess (WITH THE CAPSULE COMPONENT) the simplest of objects with the simplest of code.
If you can possess an object along with the capsule component and not have any issues, then it’s your code for the (above) blueprint that’s the issue.
You SHOULD be able to have a character possess a vehicle with no collision issues, which is why I suggested to create a simple new blueprint from scratch to make sure.
I was unfortunately having the same issue with a new test actor with the same logic, but I did find the solution (which was a bit ridiculous).
It seems as though the gun I was holding was somehow colliding with the vehicle and producing these odd physics. The guns are supposed to no-collide when picked up, but for some reason weren’t (on the client specifically it seems). I disabled their collision with vehicles specifically and problem solved
So yeah, nothing wrong on Unreal’s end, my fault. I just couldn’t figure out why for a while.
It could be the gun. It could be landscape. It could be the character. It could be the bird, the bush, the rocks, invisible actors, the list goes on and on…
That’s why I suggested the completely new blueprint, to help you rule out possibilities, because your original post led me to believe there was a network/data/streaming issue.
Seriously, reread it. No way I’d be able to come up with a solution that the GUN was the issue.
Relieved you figured this out; there’s more hitches for you right around the corner.
I apologize if I worded the OP badly. I knew it was a collision/networking issue rather than a possessing issue which is why I was a bit reluctant to recreate the whole thing, as it’s a lot of stuff going on. I apologize if I came off as hostile at all, I truly didn’t mean it if it sounded like I was. Networking can be a bit of a headache because ONE wrong line of code results in a mess like this