#non possessed player attached to other actor jitters
1 messages ยท Page 1 of 1 (latest)
you call these on server in the first execution pin of sequence
CharacterMovement->DisableMovement();
CharacterMovement->StopMovementImmediately();
and in the second pin you are calling it again for no reason
if you did this in previous blueprint project , can you share screen shots?
so that only happens to server only
yes
this block is only server
if (HasAuthority())
{
CharacterMovement->DisableMovement();
CharacterMovement->StopMovementImmediately();
}```
next to it is on server and client both
no
second block is on server and client both
missty can you recreate that in blueprint now? those 2 nodes
authority check only in the first pin of sequence
second pin will run on both server and client
in first pin you are checking authority, this is why it will only run on server
so this one is right? or i need to add something to remote?
remote is only client, no server
you don't need this way
also add
CharacterMovement->NetworkSmoothingMode = ENetworkSmoothingMode::Disabled;
in the second pin after SetMovementMode
@quasi kestrel good thing is jitter completely stopped. what i need to do fix that simple rotation issue on passengers?
from character movement set these two variables to false
bOrientRotationToMovement
bUseControllerDesiredRotation
you can do it before attaching the passengers
this will tell the character to not rotate the body with mouse movement
still rotates body
that whole thing happens in multi cast
attach to component don' tneed in multicast
call this after you call attachactor function by server
also rename attachactor to fixjitter, then attach to component call
attach to component
k
like another custom event running on server? or 3rd sequence?
nah go out from fixjitter function
you are calling fix jitter by server
call attach to component right after fix jitter call
remove these two calls from here
how is your camera attached to character?
through mesh - head socket
use spring arm
character->springarm->camera
in details panel of spring arm
bUsePawnControlRotation = true
in details panel of camera
in details panel of spring arm = false
springarm add to character
camera add to spring arm
still character rotates on passenger
you mean the self root?
not possible, this is that image
this is dragging and dropping screenshot
ok mesh ๐
yes mesh is your character
sandboxcharacter is your character class, not player
this class controlls your character mesh
its still rotating whole character
show mouse rotate function
in mesh?
its gasp default
yeah just sow the screenshot what they does
they maybe not using camera to rotate player, just a guess
when i imported the gasp, it didn't use the camera that is sued in gasp template. so i was using normal camera added to the character
just create a bool variable, when passenger enter vehicle set it to true, and when you move mouse check if not in vehicle rotate else do nothing
this is a quick fix
here check the state of bInVehicle before calling the input functions
when you attach character to vehicle, set the character rotation to vehicle forward vector
this still stuck in different angle from the direct of interaction
get forward vector and convert it to quaternion rotation, and than set it
this is not working
you can directly call get actor forward vector and convert it
i did, thats also stuck
rotation happens after stopping movement , that may be the reason?
because you blocked the input using binvehicle
you need to find why character is rotating when you disabled the rotations
once you find this, you can solve it
when you disable rotations, character will not rotate but you can look around with camera
yes
ok
I found issue in your code
whats that
you are passing true
remove passings and keep it false
just keep execution pin the white color
it worked
party
non gamer ๐ ?
ok thanks
I only pubg in my free time like 30 minutes everyday
cool.
if you got more issues just write here, I will try to help
ok, ill do exit vehicle tomorrow, ill ping you if i need help
exit vehicle will be the reverse of enter vehicle
undo every thing when exit vehicle
you need to detach the actor character, not the scene
even if i attach to component, i have to detach it from actor?
always attach/detach actor to actor, component to component
im using scene comp and variables from parent class, does that affects and messes up multiple child class?
if you are using scene comp as a vehicle seat its fine
you can attach playeractor to vehicle seat
and detach playeractor from veihcle seat
target should be player actor to detach
ill try it
worked. perfect
good
middle screen is server
they are dancing
any reason why only happens to server? every clients sees the detached player normally, but server sees all the detached players dancing from ROOT i think.
try detach on multicast just for test
only to server as ususal
you should reverse all the things you did when attach to vehicle
the exact way
if you disable something on server, re enable it on server
same for client
set colliison you are calling it in server and in multicast
if you call it on second pin, it will be call on server and clients
no need seperate call on server
set ignore corrections to true for testing
it still jitters to server, also the client is different position in different screen when sprint in circle
show attachment code
what is the target when you attach?
its so many castings, you should use interface in this case
but its not related to the issue
when you don't enter vehicle, its not dancing on server?
no, its fine before entering vehicle
its happen on passenger or driver?
so far i just implemented passenger exit. i just encountered this.
ill impliment driver exit if you want rightnow , ill ping you once its done.
I would recommend to do vehicle in C++
base vehicle class in C++, and make your vehicle bp extend from it
if C++ is difficult for you, follow this video
https://www.youtube.com/watch?v=qCSN1oScO4E
Try my C++ Survival Game Course:
http://bit.ly/unrealsurvival
Discord:
https://discord.gg/meFRZfm
Business Email: contact@reubs.io
once you make it in C++, I will be able to help you
so, for now this is how far we can go only with blueprint?
nah, with blueprints you can solve it for sure
problem is I don't use blueprints and can't share snippets with you
vehicle should exit driver and start possessing driver
you are not passing anything in function
those pins are from previous try
already possessed player character in vehicle pawn
check output log why rpc fails
checking
void ACustomVehicle::ActualDriverExitVehicle() // called by server
{
if (!HasAuthority() || !IsValid(Driver) || !GetController())
{
return; //stop this function and don nothing if conditions not match
}
GetChaosVehicleMovement()->SetMaxEngineTorque(DefaultMaxTorque); //stop vehicle before exiting
// Handle driver detachment
IsSeatOneBusy = false;
HandleDetachment(Driver, SeatOneExit);
// Return control to the driver
GetController()->Possess(Driver);
Driver = nullptr;
I think you will get the idea how you should do it
cbp soldier is child of cbp sandbox character
set vehicle to the owner of driver
before possess? in character?
remember only driver needs ownership
when you possess vehicle, call a function from character refference setowner and pass this or self
target should be character and new owner is vehicle
you should do it in vehicle class cause you are possessing vehicle
when you possess vehicle set owner of the player