Currently what I have is I can grab an object in the world with my mouse (I just hide the object when it is clicked on), then when I move some where else and click in the world it moves the object to the location I clicked on and unhides it. This gives the player the feeling of picking up the object and dropping it elsewhere.
When I turn on the physics for the object through, the object won’t move to the new location, it just reappears at the location it was originally when I first clicked on it.
What could be stopping it from moving? I am using the ‘Set Actor Location’ node to move the object to that place. Do I need different node for objects with physics?
So I have been playing around. I still haven’t figure out what is causing the issue, but I have narrowed it down.
To make things simpler I decided to create a new project. I imported a mesh, then created a BP and added that mesh to it’s component section. I turned on the physics and put the code from the screen shot in it and it worked fine. It moved the mesh 500 units in the Y axis.
Then I made one change, as this is the way I am doing it in my game. The change was, instead of creating a blue print as you normally would I chose to make a blank blueprint, and then right-clicked on it and choose ‘Make a Blueprint based on this’ which makes a child blueprint of the original. This is important as it allows me to put code in only the parent BP and all the children have that code.
When I run the level now, the mesh doesn’t move across the floor. So the only difference between the two BP’s is that one is a child and one isn’t. The child can’t be relocated using Set Actor Location, when the physics is turned on.
I have no idea how to work around this issue, any ideas?
Here is some screenshots before and after. you can clearly see one mesh moves and one doesn’t.