# When the star beam touches a player (including a stationary one), stop spinning and start hitting

**URL:** <https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822>\
**Category:** Character & Animation\
**Tags:** begin-overlap, unreal-engine, hit-event, question\
**Created:** [May 24, 2021, 6:48am UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822 "2021-05-24T06:48:05Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Etyuhibosecyu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/etyuhibosecyu/32/1044081_2.png) [@Etyuhibosecyu](https://forums.unrealengine.com/u/Etyuhibosecyu)\
**Post date:** [May 24, 2021, 6:48am UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/1 "2021-05-24T06:48:05Z")

</div>

**Warning** : the text of this question has been translated from another language, strange language constructs are possible.

There is a big star. The player must be able to pass between the beams and hit her. At the same time, these rays rotate, and if one of them touches the player, the star already begins to beat him. Importantly, it should work **regardless of** whether the player is moving or standing. Moreover, if the player is **between** the rays, his health should not fall, that is, the shape of the collision should repeat the shape of a star, and not just be a convex shell. How can I do that? At least a few key phrases. Here’s what I’ve tried:

- Hit and BeginOverlap events. The first does not fire when the player is standing, and the second fires or does not fire randomly, so the star continues to rotate periodically.

- SkeletalMesh with Enable Per-Poly Collision and StaticMesh with Use Complex Collision As Simple. In both cases, when using BeginOverlap, the convex hull collides rather than the exact star shape.

- Stop hitting during EndOverlap or if BeginOverlap has been absent for some time. In the first case, due to a known bug, they stop before starting (BeginOverlap and EndOverlap work together, one immediately after the other), in the second, due to the first point, situations are inevitable when, during this time, no matter how long it would be, BeginOverlap does not work even once, and the star makes a scanty, but turn. In addition, if this time is too long, the player will receive blows even after he has moved away from the star.

EDIT: BeginOverlap and EndOverlap unexpectedly have got working correctly. But complex collision is not working neither for skeletal mesh nor for static one. I even tried to split the star into multiple meshes by beams but it is some kind of paradox that even in this case player collides with the bounding box of the star, not with every beam. Why it can be so?

EDIT2: I have detected that BeginOverlap and EndOverlap work incorrectly only if enable per-poly collision on skeletal meshes. So it is better to use static meshes. Now the star correctly collides, for example, with the bush (HISMActor), or with the weapon (Actor - Weapon - NearFightingWeapon - FighterOMB) (OMB is an in-game code name), or with the player name (Widget) (now this collision is disabled to prevent errors), but not with the player capsule. So the problem is in the player capsule. What can it be? Here is the screenshot of the collision parameters of the player capsule.

 ![339863-2021-05-26-17-55-06.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/9/1/b91962f6f048c1e0325bd1967e4c5d5791825bfd.png)

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [May 24, 2021, 3:55pm UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/2 "2021-05-24T15:55:46Z")

</div>

Hello! Can you provide more information:

- what type of actor is Star, what collision components it has?
- the same for player
- the same for beams

---

<div class="post-metadata">

**Author:** ![Etyuhibosecyu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/etyuhibosecyu/32/1044081_2.png) [@Etyuhibosecyu](https://forums.unrealengine.com/u/Etyuhibosecyu)\
**Post date:** [May 24, 2021, 4:21pm UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/3 "2021-05-24T16:21:41Z")

</div>

1. Actor - Pawn - Character - Enemy - ShootingEnemy - WhiteStar\_Blueprint. It has default capsule, but it is not used. Also it has skeletal mesh WhiteStar with Enable Per-Poly Collision in the settings of mesh and component, and also I tried static mesh WhiteStarStatic with Use Complex Collision as Simple. Both mesh components have collision type BlockAllDynamic with Generate Overlap Events and Simulation Generates Hit Events.

2. Actor - Pawn - Character - Player - ProperPlayer - Fighter1Player. Here the default capsule is used, and it has the same collision type.

3. Beams are just parts of the star, it is one whole mesh. I badly know how they are called in English, maybe not “beams”?

---

<div class="post-metadata">

**Author:** ![ugmoe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ugmoe](https://forums.unrealengine.com/u/ugmoe)\
**Post date:** [May 24, 2021, 5:32pm UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/4 "2021-05-24T17:32:27Z")

</div>

You could attach a StaticMesh to your star

Constantly rotate the StaticMesh

Use “OnBeginOverlap” to notify when the StaticMesh touches the Pawn

 ![339665-capture2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/c/b/6cb4e8c05f6e9fee86970073165ebcfc262d9d63.jpeg)

 ![339664-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/7/8/c78e478fff5c6c553e95e070588675ce74148b94.jpeg)

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [May 25, 2021, 2:24pm UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/5 "2021-05-25T14:24:55Z")

</div>

You say that you are using Skeletal mesh for Stars. Is this mesh is animated? If yes - ok, but if not, then it is much more effective to constaruct your object from several static meshes. It more optimal from collision and rendering point of view

---

<div class="post-metadata">

**Author:** ![Etyuhibosecyu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/etyuhibosecyu/32/1044081_2.png) [@Etyuhibosecyu](https://forums.unrealengine.com/u/Etyuhibosecyu)\
**Post date:** [May 26, 2021, 3:04pm UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/6 "2021-05-26T15:04:45Z")

</div>

Bump. I have done still one edit.

---

<div class="post-metadata">

**Author:** ![Bob3DGames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bob3DGames](https://forums.unrealengine.com/u/Bob3DGames)\
**Post date:** [May 26, 2021, 3:45pm UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/7 "2021-05-26T15:45:25Z")

</div>

You could use a line trace. Then you won’t have to worry about geometry overlap events at all. In this case the LineTraceByChannel node is the one you want. Create a line trace along the beams each tick and it will tell you what actor it hits.

- Set Start to the location of the star.
- If you put a socket at the end of each beam in your skeletal mesh, you can set End to the position of the socket.
- Check the Hit Actor to see if it’s the player.

 ![339867-star-beam-line-trace.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/5/645fd8b13bbbe2d34b9fea59326249338d3e1e39.png)

PS It sounds like ‘beams’ is exactly the right word. ‘Rays’ is just as good.

---

<div class="post-metadata">

**Author:** ![Etyuhibosecyu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/etyuhibosecyu/32/1044081_2.png) [@Etyuhibosecyu](https://forums.unrealengine.com/u/Etyuhibosecyu)\
**Post date:** [May 27, 2021, 8:36am UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/8 "2021-05-27T08:36:02Z")

</div>

Yes, it has got working! Thank you!

---

<div class="post-metadata">

**Author:** ![Bob3DGames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bob3DGames](https://forums.unrealengine.com/u/Bob3DGames)\
**Post date:** [May 27, 2021, 9:15am UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/9 "2021-05-27T09:15:22Z")

</div>

Excellent! Please can you accept my answer? Then it shows green in the list so people know straight away that you’ve solved it.

---

<div class="post-metadata">

**Author:** ![Etyuhibosecyu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/etyuhibosecyu/32/1044081_2.png) [@Etyuhibosecyu](https://forums.unrealengine.com/u/Etyuhibosecyu)\
**Post date:** [May 27, 2021, 9:20am UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/10 "2021-05-27T09:20:22Z")

</div>

I see that your answer is voted up. Maybe you have not seen this yet?

 ![339963-2021-05-27-12-16-59.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/2/d/92d54d7eda6d86e1b5785de0e9c2822de9fea0b9.png)

---

<div class="post-metadata">

**Author:** ![Etyuhibosecyu](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/etyuhibosecyu/32/1044081_2.png) [@Etyuhibosecyu](https://forums.unrealengine.com/u/Etyuhibosecyu)\
**Post date:** [May 27, 2021, 9:23am UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/11 "2021-05-27T09:23:55Z")

</div>

Sorry, I haven’t yet understood that voting up and accepting are different things. Now your answer is accepted.

---

<div class="post-metadata">

**Author:** ![Bob3DGames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bob3DGames](https://forums.unrealengine.com/u/Bob3DGames)\
**Post date:** [May 27, 2021, 10:31am UTC](https://forums.unrealengine.com/t/when-the-star-beam-touches-a-player-including-a-stationary-one-stop-spinning-and-start-hitting/483822/12 "2021-05-27T10:31:13Z")

</div>

Thanks. I’ve voted the question up so you get some karma as well. 🙂
