How to add box collision to subcomponent? - unreal-engine4

everyone. I am using ue4 blueprint to construct a pipe(Underground pipes), and I hope I can click the pipe then show the pipe's information. However I found that onclicked event works only when I clicked on the Box collision like this
My blueprint use the Spline Component, but when I adjust pipe in level, the collision box won't change ,please look my blueprint
then how can I set all the pipe's every sub spline mesh component's collision box via construction script? Thanks very much!!!

I found the reason, please click here (add spline mesh component function in blueprint)
then you will find the details on the right side, get the collision correct. I never know that this blueprint function has details too!

Related

3D Mesh modification by collisions push in runtime in Unity

please can i have a little help guidance in something, a about mesh curving , kind of look around but would like your advice
This object (the circle shape) is getting deformed like the yellow part, what do you advice me about it please?
Any script to see the mechanic or similar examples? (Attached gif)
I tried to see some but only works with mouse click ( I am very new to mesh binding )
Like What you watching here
thanks
I would start by describing the whole shape as list of points.
Then you should be able to move those points either via physics or "manually" (by doing Physics2D.OverlapPoint and some math during movement).
With that it's just a matter of constructing runtime mesh, there are tutorials on how to do that (I think Freya Holmér has one), just look for "procedular geometry" or similar.

Grappling hook for a Pawn simulated by physics

Making a sidescroller and is using a Pawn (Cube) with simulated physics and would like to make a magnetic grappling hook for movement.
Would you know a smart way to implement this?
many thanks!
If I understand you correctly , you want to animate the cube as its attached to magnetic grappling hook
Lucky its quite clear bec there is something called "Cable component" that do exactly what you looking for .
you just need to enable the plugin inside the engine. and follow the documentation steps Unreal docs cable component to achieve that , just scroll down to this part "Attaching Objects to the Cable ends" to give you solid start , then you can check how to use in inside blueprint to drive the game parameters you want.
Hope that works for you.

Right way of handling mouse input

I was playing around with navmesh agent and im pretty happy about the results i get. But i am a liitle bit concerned about the code getting complicated.
I want to organize my code in a way that allows me to edit it later without trying to figure it out what i did there.
what i need is basically is this:
Handle mouse click on ground, enemies, objects, skill / spell targeting, gui
Handle mouse over objects, enemies, gui
my approach was:
in update function raycast mouse position
check if the mouse was clicked
if clicked check the target tag : enemy, ground, object (loot) and
call a related function
if not clicked check the target tag again for hover effects.
so what would be the best way to handle all of these listed above? any code examples in any language would be appreciated.
thanks for your time
its been a while that i asked this question. i ended up using state design pattern explained here.

How to make path in box2d in iPhone

I have a path which will be on bottom of the screen where insects will walk. But my path is not a straight line, it have ups and down. So how can I my insects walk my jagged line? The black line is my path. I want my insects to follow the up and down parts and I would like to achieve this using box2d. Any help? I don't know from where tostart to make this work. I haven't yet started to code. How can I make a bodyDef in box2d for the picture path below?
I assume that with the word "path" you mean the ground represented in the image, otherwise you can ignore the rest of my answer ;)
My suggestion is to follow these steps:
Create a body definition for the ground image. I use PhysicsEditor (free trial) that automatically creates the body definition for an image. If your image is transparent the body definition will map pretty well the shape in the image. PhysicsEditor exports the body definition via .plist which can be easily loaded via code.
Create a body definition for your insects (as above).
In your code create a static body for the ground using the ground body definition.
Create a dynamic body for each insect using the definition made at bullet 2.
Add gravity.
Now you'll see your insects on the ground. If you drag them (using the Mouse Joint provided by box2d) you will see that they react realistically to the ground and do not intersect it.
Finally you need to apply a force (in box2d) in order to autonomously move the insects.
This is just an high-level description of the steps you should follow. More specific information for each step is provided by the PhysicEditor documentation and box2d documentation.
I hope that this is going to help you.

How to use Trail Renderer in unity3d?

I am new to unity3d I have a movable object that I want to trace it . according to my search there is a function called Trail Renderer I don't know how to use it in script any one can provide me with how can I use it in clear way
thanks
It's not a function, it's a script.
Real easy to use, just select a game object and go to Menu->Component->Effects->Trail Renderer. Just follow the documentation page for filling in the material properties. All of the trail renderer properties are exposed to the Unity editor's inspector so you can play with start and end widths, material props., etc w/o having to write additional code.