Hello! new to unreal and working on a prototype to learn, right now I have the following script on one of my Blueprints. My goal is for whenever the blueprint this script is on is interacted with, it checks its Box Collision component, “Trigger,” to see if there is an actor of the Furniture Class inside it. If so, i want it to move that actor to the Blueprint’s position (Nothing in the blueprint has collision, just think of it as a slot to put an item on). The specific actor I’m trying to place is F_testchair, a child of the Furniture class
Can you print what is coming out of Random and being plugged into Target and Display Name? Is it possible its not grabbing the chair properly?
RANDOM will re-roll for evey downstream pin pull, just FYI. So for both of those paths its possible you are getting something different if there is more than one thing in OverlappingActors. So it’s possible you are getting the name of one actor but moving another. If thats not the intent you may want to promote that output to a variable and use that.
Also, where is it getting the Actor Location/Rotation? If you hardcode those numbers, does it work? Right now it looks like you want to move things to where the BP is which might be the intent.
Thanks for the heads up on random! I’ve updated the script to save the actor we get from Random to a variable and then reference the variable for everything after that.
Everything looks ok at a glance. Is the chair’s mobility set to moveable or static?
Other than that, maybe try to skip the graph entirely. Drag one chair actor from the level into the Event Graph to get a hard reference, and wire EventInteract → Set Actor Location on that reference with the same literal value. If it moves, the bug is somewhere in the overlap/random/execute chain. If it doesn’t, the problem is outside the graph.
I think I’m miss-understand something, I’m trying to drag my F_testchair to the event graph but it doesn’t seem to be working. I took a video, I’m not sure what I’m doing wrong. https://youtu.be/SwSTQ3fqUxw
Ahh its a BP. Nevermind. Just try to take all the logic out in between the actor and the set actor location or make something simple like this to make sure its your graph. But I would again make sure the two random chains are not reporting something different.
If chair refuses to accept any set location commands, the actor (or one of its components) probably has mobility set to Stationary or Static where it should be Moveable. Or, on the off chance SetActorLocationAndRotation is just busted in your build, try running the basic SetActorLocation and SetActorRotation nodes back to back and see if either of them work.
What is the deign purpose of this function anyway? Is the player tidying up a messy room after an event or something? Or Are you trying to snap furniture to sockets as a build/decorating mechanic?
If you’re just tidying up a designed mess. Might be easier to move the interaction function to the furniture itself, and have an instance editable reference to a “slot” actor which you can directly assign in level editor with the eyeydropper by the variable. Then on interact with furniture, check if “slot actor” is valid, and if so have chair set its own loc to the slot actor.
Or, if this is for a build system of some sort, when you want to build a chair or whatevs, trace from player and if trace hits a “slot actor”, get its transform from the hit actor pin on hit results, and just spawn the chair at that transform.
In either case, just gotta make sure the origin of furniture and slots are consistent. IE if chair mesh in furniture actor is at 0,0,0 and 0z is the floor, the slot marker should also be at 0,0,0 in bp and flush with floor. If chair’s origin were at center of mass, snapping it to a marker sitting on floor would try to embed chair in the ground (and may cause the set loc command to fail).
I’ve verified its set to moveable, I’m doing some physics stuff with the chair as well and that works just fine. Ive also tried just the standalone set location. Maybe i’ll go to 5.7 and see if it works there.
For context the player is scavenging furniture from a junkyard, cleaning it up and then selling it. The slot is where the player will put the furniture when its ready for sale, and thats where they can set the price, AI customers can come to the slot as they wander or to come purchase the item.
I’ve not had any problems setting locations in 5.8. Though I rarely use set actor and location combined node. If I need to set all the things, I tend to just use set actor transform.
How far away is the junkyard being salvaged from the shop? If it’s far away, probably easier to just delete chair from world when collected and store the class name (or an id if using data table/data assets) on player in an inventory array of some sort, then spawn a new chair right on the slot using class saved in “inventory.” Spawn Actor from Class is pretty consistent.
Is the location of the chair being set on tick or something or otherwise being controlled by something else? Can you try and just set the location of a sphere or something?
Good question. It had just popped into my head that they were checking if the slot actor was overlapping furniture, and if furniture is salvaged outside shop, I’m wondering if maybe it’s attached to player somehow to be “physically” carried (otherwise how would it overlap a shelf in the shop?). If chair actor is indeed attached to player pawn, set loc&rot would appear to fail since attachment would override loc on next tick. If it is indeed attached, even if there’s some unseen code in furniture class that’s detaching it from player when placed, there could be a race condition if detach and set loc happen in the same frame,
This might be the case. I am using a physics handle and the Grab Component at Location node for carrying objects around. I’m running the Release Component node before that and can confirm thats working because the chair visible drops, but maybe something is going wrong here and this is causing the chair to not respond to the Set Location node.