I’m having an issue with ChildActors attached to the motioncontrollers. I need to replicate the childactors events, but even with “replicate movement” set to off the clients have the attached actor moving faster than the motioncontroller. It’s not no late update, it’s doing the opposite, sort of like the server is doing prediction. Could be an engine bug or part of GripMotionController?
As in you are directly attaching another actor to the motion controllers themselves? I would check the tick order in that case, if the controllers are ticking before / after the child actors it can cause different behavior. Child COMPONENTS are auto set to tick after their parent components so that they get the correct location when they update their position.
I haven’t looked at how they handle child actors and tick ordering, regardless attached actors shouldn’t be “faster”. I don’t know what your setup is.
If you mean rescale them on grip, pass in a different scale in the transform you give it. If you mean rescale in the world…set the actors scale.
Everything looks good in the world. The thing i dont get is that when i grip the object, it resizes to the default size. Wich is way too small in case.
I dont think the problem is coming from the pick up drop blueprint as i do not change anything about the scale
Yeah no, it is definitely in the grip function, you need to pass in the transform of the actor you are gripping, not the transform of the motion controller, if you want it to snap to the controller then use a “MakeTransform” node and leave the location as 0,0,0 and tick the “Is already relative” checkbox, but you will need to fill in the Scale part of the transform with the scale of the actor you are trying to grip.
With how you currently set it up you are creating an empty transform with only a location set so it is defaulting the scale of the gripped actor to 1,1,1.
I allow it to change the scale of the gripped actor specifically because it is handy sometimes to say add a 25% scale increase to held items (papers/tablets/ect).
I have a ChildActor-component as a child to MotionController. The ChildActor is set to BP_Gun which is set to replicate, but not replicate movement (I tried replicate movement, it gave the same results).
I’ve tried setting the tick order in every way possible for the child actor, and it does the same thing. I think the problem lays with the fact that the ChildActor is it’s own actor, and since it’s set to replicate it does UE-magic and predicts it’s movement… I need BP_Gun to be replicated since it calls the server to spawn projectile etc. When Replicate is set to false the events simply aren’t, even though the parent pawn is set to replicate. It’s really halted my progress atm since I don’t want to have separate pawn classes for every weapon available.
Is it actually a gun? Like just something that you shoot? If so don’t attach it, use one of the grip functions instead, even though attaching shouldn’t be a problem in the first place.
I don’t get exactly what you are doing? I have multiple actors that I just “grip” and freely call events from, the only thing that gets modified is movement replication which doesn’t effect RCPs sending.
I don’t use any of the Grip functions that comes with the plugin. I just have the ChildActor component set up in the PlayerPawn BP, I don’t do anything at runtime with it. The RPCs are behaving as they should but the location of the BP_Gun actor is not. You can easily repro it by just making a child actor actor component and parent it to a motioncontroller. Set the selected actor to an actor that is set to replicate, and you can see it move infront of where the motioncontroller is moved.
Using the provided grip function might just work though.
If you aren’t using the grip functions, what is your reasoning for using a child actor component instead of just directly attaching an actor to the motion controller (AttachToComponent) and saving a reference to it?
I tried that and it gave me the same behaviour. I’ve tried with different BPs as well. Also, I’m no longer able to get GripActor to work, it constantly returns failed. Root component of GrippedActor is Skeletal Mesh, there is no other component attached to the MotionController component either so no issues with collision there. The exact same setup works in my 4.12.5 project. Here’s a screenshot of what I’m doing:
I didn’t even think to look there. It says that it’s always called by the client, event though I use an authority switch and specifically call event on server. Worth noticing that I’m hosting a listen server and the client I’m playing as is the host. Afaik there is no limitation to using a listen server?
I specifically check for listen servers as servers in the code for it and have tested with them.
However is not set until first tick ( is when the engines default controllers decide locally controlled as well). So I assume that your grip code is taking place during Begin Play? Which is prior to when the controllers start checking for their owning state and net state.
I can probably just set it on begin play as well (there aren’t role transitions), I think that the blueprint event for it should fire after the controllers code event. I didn’t anticipate people gripping objects prior to the players actually controlling the pawn.
Prior to a code change though you can spawn it sometime after begin play and grip, or just attach instead since you didn’t plan on using the grip functions.
I did get attach to work on begin play. I also tested to grip after begin play on player input and that worked as well with some minor interesting issues. It was resolved by checking “Generate Overlaps” on the root component of the gripped actor.
I use the vive controller mesh as the root to then align the gun against, and since a scene component can’t be the root it works with one caveat: The physics collision during grip only seems to account for the root mesh’s collision?
I can work around the issue with begin play by just adding a delay, so don’t change just because of me. Thanks!
It should be fixed anyway, but your setup is weird, a vive controller mesh is a primitive component and is fine as a root for gripping. Regardless though are you gripping the vive controller mesh and then parenting the gun to that hand? Why isn’t the hand mesh just childed to the controller and then you grip the gun directly? Your setup is pretty confusing to me right now.
Hello,
Any chance to share a empty scene correctly setuped?
It will help a lot newb like me.
plug/unplug and see what happens is the poor way to learn when you have a flat brain.
finger crossed.
Regards,