I had a question, I’ve been working on a game similar to Slime Rancher.
My question is, can someone explain to me how to make a vacuum activated by left mouse button? I’ve tried a few things but I’ve never worked with vacuum things in UE4 and don’t know anything about it.
Here’s an example of what I mean:
I already made systems like this.
One using “radial force” component with a negative value.
The radial force obviously is spherical and can affect objects that shouldn’t be (not in the front range of the weapon for example).
My solution was to have my objects ignore radial force by default, so I can choose when they can be attracted. The good moment is when they are in front of the weapon, so I’ve added an invisible cone attached to the canon and when an object gets in the cone, it stops ignoring force, and when it gets out of the cone, it ignores force again.
Then it is just about the input, the force of the component was 0 by default, so it doesn’t attract anything until I press left mouse for exemple, on press it sets the radial force to -50 000 or whatever negative value sits best.
This is a physical approach that I prefer because movements look more natural.
An other way is to use a line trace aligned to the canon. When an object is hit by the trace, it activates a timer inside of this object. On this timer, the object changes its position (on le line object/weapon, but close to the object).
Unfortunately most of my work from last years is lost. I still have a packaged prototype of this mecanism though, but here I’m using an impulse instead of constant force, don’t know if it is what you need
Multiple, not limit, as long as it’s in the range, and it has to go to 1 point, the gun’s muzzle. I’m currently using the first-person template, so also the first person gun. I’m on the good track but it still ain’t it, I’ve been working on it the whole day, currently it’s 2:22 AM and I started at like 13:30 PM… But there has to be something. For real, thanks for your time.
BTW, sorry for not answering the whole day, couldn’t go in my room the whole day cuz some things happened and my room had to be cleaned with chemicals (No nobody died, fortunately) thanks for all your effort.