#non possessed player attached to other actor jitters

1 messages ยท Page 1 of 1 (latest)

quasi kestrel
#

good

quasi kestrel
#

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

true cargo
#

if you did this in previous blueprint project , can you share screen shots?

quasi kestrel
#

I did only in C++

#

if (HasAuthority()) means if this is server

true cargo
quasi kestrel
#

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

true cargo
#

missty can you recreate that in blueprint now? those 2 nodes

quasi kestrel
#

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

true cargo
#

so this one is right? or i need to add something to remote?

quasi kestrel
#

remote is only client, no server

#

you don't need this way

#

also add
CharacterMovement->NetworkSmoothingMode = ENetworkSmoothingMode::Disabled;

#

in the second pin after SetMovementMode

true cargo
#

@quasi kestrel good thing is jitter completely stopped. what i need to do fix that simple rotation issue on passengers?

quasi kestrel
#

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

true cargo
#

still rotates body

quasi kestrel
#

set it under multicast

#

both server and client should set it to false

true cargo
#

that whole thing happens in multi cast

quasi kestrel
#

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

true cargo
#

k

quasi kestrel
#

only on server

#

remove it from fix jitter function

#

call it after fix jitter

true cargo
#

like another custom event running on server? or 3rd sequence?

quasi kestrel
#

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?

true cargo
quasi kestrel
#

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

true cargo
#

still character rotates on passenger

quasi kestrel
#

drag drop on character

#

drag spring arm and drop on top of character

true cargo
#

you mean the self root?

#

not possible, this is that image

#

this is dragging and dropping screenshot

quasi kestrel
true cargo
#

ok mesh ๐Ÿ‘

quasi kestrel
#

yes mesh is your character

#

sandboxcharacter is your character class, not player

#

this class controlls your character mesh

true cargo
quasi kestrel
#

show mouse rotate function

true cargo
#

in mesh?

quasi kestrel
#

the function you call when you move mouse

#

generally Turn and Lookup

true cargo
#

its gasp default

quasi kestrel
#

yeah just sow the screenshot what they does

#

they maybe not using camera to rotate player, just a guess

true cargo
#

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

quasi kestrel
#

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

quasi kestrel
# true cargo

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

true cargo
#

this still stuck in different angle from the direct of interaction

quasi kestrel
#

get forward vector and convert it to quaternion rotation, and than set it

true cargo
#

this is not working

quasi kestrel
#

you can directly call get actor forward vector and convert it

true cargo
#

rotation happens after stopping movement , that may be the reason?

quasi kestrel
#

because you blocked the input using binvehicle

true cargo
#

wants to remove it?

quasi kestrel
#

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

true cargo
#

ok

quasi kestrel
#

I found issue in your code

true cargo
quasi kestrel
#

you are passing true

#

remove passings and keep it false

#

just keep execution pin the white color

true cargo
#

it worked

quasi kestrel
#

party

true cargo
#

this is huge, ill give you free copy of game when its released

#

thanks

quasi kestrel
#

Thanks, but I don't need ๐Ÿ˜„

#

just enjoy development

true cargo
true cargo
quasi kestrel
#

I only pubg in my free time like 30 minutes everyday

quasi kestrel
true cargo
quasi kestrel
#

undo every thing when exit vehicle

quasi kestrel
#

you need to detach the actor character, not the scene

true cargo
quasi kestrel
#

always attach/detach actor to actor, component to component

quasi kestrel
#

in vehicle case: player detach from vehicle

#

playeractor detach from vehicleactor

true cargo
#

im using scene comp and variables from parent class, does that affects and messes up multiple child class?

quasi kestrel
#

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

true cargo
true cargo
quasi kestrel
#

good

true cargo
#

middle screen is server

quasi kestrel
#

they are dancing

true cargo
# quasi kestrel 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.

quasi kestrel
#

try detach on multicast just for test

true cargo
#

only to server as ususal

quasi kestrel
#

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

quasi kestrel
#

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

true cargo
quasi kestrel
#

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?

true cargo
quasi kestrel
#

its happen on passenger or driver?

true cargo
#

ill impliment driver exit if you want rightnow , ill ping you once its done.

quasi kestrel
#

I would recommend to do vehicle in C++

#

base vehicle class in C++, and make your vehicle bp extend from it

#

once you make it in C++, I will be able to help you

true cargo
quasi kestrel
#

problem is I don't use blueprints and can't share snippets with you

quasi kestrel
#

vehicle should exit driver and start possessing driver

#

you are not passing anything in function

true cargo
#

already possessed player character in vehicle pawn

quasi kestrel
#

check output log why rpc fails

true cargo
quasi kestrel
#
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

true cargo
#

cbp soldier is child of cbp sandbox character

quasi kestrel
#

set vehicle to the owner of driver

true cargo
quasi kestrel
#

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

quasi kestrel
#

when you possess vehicle set owner of the player