当前位置:网站首页>UE4 collision
UE4 collision
2022-07-25 10:37:00 【Flying Pig】
brief introduction : In the scene , Collisions exist all the time , Sometimes we need to collide , Sometimes we don't need to collide , Want to close the collision , Illusion provides a collision mechanism . It can solve the collision problem well .
One 、 View collisions
Two 、 Delete and add collisions
3、 ... and 、 Introduction to collision attributes
Four 、 How collision events and collision responses work
5、 ... and 、 Custom collision
Next, we start to analyze the illusory collision mechanism :
1. View collisions : Click on the model, click on collsion

2. Delete and add collisions

Automatic collision generation is generally not recommended ( Not quite the collision we want )

3. Introduction to collision attributes

4. Collision events
Before understanding the collision event , We need to understand the meaning of blocking and overlapping .
stop : It refers to two objects with collision. As long as they touch, they will block , however , You need to enable Simulate the generation of hit Events (Simulation Generates Hit Events) To perform Event hit , This function is in the blueprint 、 Destructables Actor、 Trigger, etc .
overlap : Two objects containing collisions overlap , Overlapping events will occur .
So how do you set that Hit Events and Overlap event
Reference list :

Hit event :

One parameter is set as follows


Overlap event :

If disabled Generate overlapping events (Generate Overlap Events), Whatever the purpose , overlap and Ignore The effect is exactly the same . In this case , The sphere is set to overlap or ignore : Make sure Generate Overlap Events It's on . As long as one of the two colliding objects overlaps, an overlapping event will be generated (Generate Overlap Events).


5. Collision response

Collision preset :
Default (Default) | Use the settings that have been applied to static mesh bodies in the static mesh body editor . |
Customize ...(Custom...) | Set all custom collision settings for this instance . |
NoCollision | No collision . |
BlockAll | Block all by default Actor Of WorldStatic object . All new custom channels will use their own default responses . |
OverlapAll | By default, with all Actor Overlapping WorldStatic object . All new custom channels will use their own default responses . |
BlockAllDynamic | Block all by default Actor Of WorldDynamic object . All new custom channels will use their own default responses . |
OverlapAllDynamic | By default, with all Actor Overlapping WorldDynamic object . All new custom channels will use their own default responses . |
IngoreOnlyPawn | Ignore Pawn And vehicle WorldDynamic object . All other channels will be set to default . |
OverlapOnlyPawn | And Pawn、 The camera and vehicle overlap WorldDynamic object . All other channels will be set to default . |
Pawn | Pawn object . It can be used for any operable role or AI Capsule of . |
Spectator | Ignore Division WorldStatic All other than Actor Of Pawn object . |
CharacterMesh | For character mesh body Pawn object . All other channels will be set to default . |
PhysicsActor | simulation Actor. |
Destructible | Destructables Actor. |
InvisibleWall | Invisible WorldStatic object . |
InvisibleWallDynamic | Invisible WorldDynamic object . |
Trigger | For triggers WorldDynamic object . All other channels will be set to default . |
Ragdoll | Simulate skeleton mesh body components . All other channels will be set to default . |
Vehicle | Blocking vehicle (Vehicle)、WorldStatic and WorldDynamic Vehicle object . All other channels will be set to default . |
Collision enabled :
attribute | explain |
|---|---|
No collision (No Collision) | This shape will not have any representation in the physics engine . Not available for spatial queries ( Ray casting 、Sweep、 overlap ) Or simulation ( rigid body 、 constraint ). This setting provides the best performance , Especially for moving objects . |
query only (Query Only) | This shape can only be used for spatial queries ( Ray casting 、Sweep And overlap ). Not available for simulation ( rigid body 、 constraint ). For character motion and objects that do not need physical simulation , This setting is very useful . Some performance improvements can be achieved by reducing the data in the physical simulation tree . |
Just physics (Physics Only) | This shape can only be used for physical simulation ( rigid body 、 constraint ). Not available for spatial queries ( Ray casting 、Sweep、 overlap ). For the simulated secondary motion on the character that does not need to be detected by bone , This setting is very useful . Some performance improvements can be achieved by reducing the data in the query tree . |
Enable collision (Collision Enabled) | This shape can be used for spatial query ( Ray casting 、Sweep、 overlap ) And simulation ( rigid body 、 constraint ). |
Collision type :
attribute | explain |
|---|---|
WorldStatic | Apply to any that does not move Actor. Static mesh body Actor Yes, the type may be "WorldStatic" Of Actor A good example of . |
WorldDynamic | WorldDynamic Used for moving under the influence of animation or code Actor type ; kinematics . The elevator and door are WorldDynamic Actor Typical example . |
Pawn | The type of any entity controlled by the player should be Pawn. The player role is " object type (Object Type)" Should be "Pawn" Of Actor Typical example . |
PhysicsBody | Any movement due to physical simulation Actor. |
Vehicle (Vehicle) | This is the default type of vehicle . |
Destructables (Destructible) | This is the default type of destructible mesh . |
Collision response :
The tracking response is used to track ( Ray casting ), For example, blueprint node Trace by channel (Line Trace by Channel).
attribute | explain |
|---|---|
Visibility (Visibility) | Generic visibility test channel . |
The camera (Camera) | It is usually used to track an object from a camera . |
Object response :
attribute | explain |
|---|---|
WorldStatic | When and WorldStatic When interacting with physical form object types , How should this physical form react . |
WorldDynamic | When and WorldDynamic When interacting with physical form object types , How should this physical form react . |
Pawn | When and Pawn When interacting with physical form object types , How should this physical form react . |
PhysicsBody | When and PhysicsBody When interacting with physical form object types , How should this physical form react . |
Vehicle (Vehicle) | When and " Vehicle (Vehicle)" When interacting with physical form object types , How should this physical form react . |
Destructables (Destructible) | When and " Destructables (Destructible)" When interacting with physical form object types , How should this physical form react . |
6. Custom collision type
Open project settings ->Collsion-> Add detection

summary : Collision needs to be selected according to the actual situation , Different scenes choose different collision .
Reference material : Illusory official https://docs.unrealengine.com/5.0/zh-CN/collision-response-reference-in-unreal-engine/
边栏推荐
猜你喜欢

About the jar package of slf4j log4j log4j2 used together

11. Iptables firewall

Angr(九)——angr_ctf

推荐系统-协同过滤在Spark中的实现

Configuration of static routes (take Huawei ENSP as an example)

Angr (IX) -- angr_ ctf

CONDA configures the deep learning environment pytorch transformers

Angr(四)——angr_ctf

Angr (VI) -- angr_ ctf

FRP reverse proxy deployment
随机推荐
Mysql5.7主从数据库部署(离线部署)
7. Shell practical gadget cut, etc
5. NFS shared services and SSH Remote Control Services
Set up lnmp+discuz Forum
Angr(六)——angr_ctf
ONNX Runtime介绍
二、unittest框架主要做什么
TCP transmission
Fastdfs offline deployment (Graphic)
shortest-unsorted-continuous-subarray
Install MySQL database version 5.7.29 under ubuntu20.04 system
js 哈希表 02
Angr(二)——angr_ctf
JS encryption parameter positioning
测试计划、测试方案
Snake games
Angr(十)——官方文档(Part1)
Erlang (offline deployment)
Configure FTP virtual user and access control
2.shell脚本之条件语句