My build system is almost done but im struggling on this last problem that doesnt seem to exist anywhere else. Basically I have the simple ghost overlay when you’re placing the actor. Its supposed to detect collision - when you hover over a wall or something itll phase through but itll do something like turn red and disable placing. In a way it kind of works but only when something like a character moves into it manually.
Here is a video of this issue , the debug text says things like “hello from mesh” whenever theres a collision but it never works with stationary objects
The code is pretty simple. The awnser hub is being rude today so I cant post screenshots but basically its just a simple “on tick” method that gets the cursor to world and then sets the position using the basic setactorlocation node. I enabled sweep, experimented with teleport, made the mesh the root component and even experimented with all collision options and the same result happens. (especially CCD)
Is there some kind of hacky solution someone out there has found?
EDIT: Not even interpolation functions help (But I do like that effect so im keeping it)
Its a building system so everything works perfectly the way it is but what isnt working is the collision. When I move the buildable object over an object the Overlap begin events only fire if the other actor moves as well, seen in the video i provided.
Ive tried everything from enabling sweep in the movement and CCD in the collision. The collision needs to be overlap all in the building phase. I have a function that sets the collision and other parameters based on if the user is building or not but that isnt the problem its a bug with moving actors in UE4 I think
Ok, are you using C++ or BP? I can think that movement call Update Overlaps for character and so when he is moving overlap events are happening. How are you creating placeable actor?
I already found the solution. Its super hacky and really only applies to projects like mine. You need a box collision that is set to the bounds of whatever should be placed and on the box you need to tick multitrace over laps or whatever.
Then you need a variable that;ll act as a n overlapping actors buffer[array of actors]. On the box add both on component overlap begin and end to the event graph and respectively add unique or remove to that overlap buffer variable you made,
Then you need a boolean that checks if the actor is colliding with anything. You set to true in the oncomponentoverlap begin and in the oncomponentoverlap end you do a branch or if statement to see if the length of the buffer is > 0. If its not, horray the item isnt blocked so you can set the isblocked boolean to false.
written for my future reference when I make a game of this genre again and written for anyone making a tycoon game or something of the sorts