# I want to create a game similar to sea battle 2 ! how can i do in ue4?

**URL:** <https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041>\
**Category:** UI\
**Tags:** hud, unreal-engine, UInterface, UI, Blueprint, question\
**Created:** [April 21, 2020, 10:42am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041 "2020-04-21T10:42:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 21, 2020, 10:42am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/1 "2020-04-21T10:42:33Z")

</div>

![300199-asset-table.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/a/b4aeed64ba82a722c5e1f5c00cde02ab40aee3e5.png)

I want to add objects to this table (drag and drop). and they should get attached to the cells of this table.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 21, 2020, 12:43pm UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/2 "2020-04-21T12:43:49Z")

</div>

Is this 2d or 3d?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 21, 2020, 1:09pm UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/3 "2020-04-21T13:09:51Z")

</div>

Here’s a quick board, see if this gets you started or at least inspires you a little. There are 2 actors:

- a tile with a Static Mesh and a Text Render

 ![300231-tileactor.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/c/3accc493fb3d396c209d3d5455f707ca71780fb3.jpeg)

- and a board with a spotlight, it spawns the tiles:

 ![300232-board.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/2/7/a2750c7fdbf3f547c1cdc3636a3a4a102a91aac6.png)

The interaction is pretty basic at this point but it could be a start.

 ![300233-board1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/3/013c98b6b0a9b852c08dd9957e439cd61d7368a9.jpeg)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/4/d/e4d80cff5cfce3b0607f8bbe553928a1dfc8b7a9.gif)](https://gyazo.com/efb91e622f74c86cba8c70c501da0e36)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 21, 2020, 1:20pm UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/4 "2020-04-21T13:20:05Z")

</div>

Never played Sea Battle - was aiming at Battleships here. Hope it’s a Hit!

---

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 22, 2020, 12:10am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/5 "2020-04-22T00:10:39Z")

</div>

It’s going to be 2D

---

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 22, 2020, 12:10am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/6 "2020-04-22T00:10:40Z")

</div>

Thank you so much for you answer. I really appreciate !  
But i am working on 2D game. So challenges i am facing is i am able to drag the object but the drop the object in ue4, only widget blueprint has that function which can be overridden. So i need to know how to create 2D table of this sort and be able to drop the object onto the cell (Some objects take more than cell)… Thanks !

---

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 22, 2020, 12:10am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/7 "2020-04-22T00:10:43Z")

</div>

it’s a 2D game !

---

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 22, 2020, 12:10am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/8 "2020-04-22T00:10:44Z")

</div>

Thanks for your answer. can drag and drop an object in this setup onto the cells?

---

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 22, 2020, 12:10am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/9 "2020-04-22T00:10:45Z")

</div>

Thanks for your answer. I am making 2D game, and i want to be able to drag and drop the object into the cells

---

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 22, 2020, 12:11am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/10 "2020-04-22T00:11:26Z")

</div>

I made table as you showed. only issue i am getting is spotlight is not showing… !! All tiles is BP\_Tile right?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 22, 2020, 6:49am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/11 "2020-04-22T06:49:03Z")

</div>

If you’re making it 2d I won’t be able to help you, not my field at all. The docs are here:

> **[Paper 2D](https://docs.unrealengine.com/4.27/en-US/AnimatingObjects/Paper2D/)**
>
> Paper 2D is a sprite-based system for creating 2D and 2D/3D hybrid games entirely within Unreal Engine 4.

And there’s plenty of tuts online. One advice I can give is: do not try to make an entire game in UMG, it is seriously limited and you will not be able to handle logic comfortably.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 22, 2020, 6:52am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/12 "2020-04-22T06:52:28Z")

</div>

The light might be facing sideways, you may need to rotate it to face down - not important at this stage. It’s just bells & whistles.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 22, 2020, 7:44am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/13 "2020-04-22T07:44:09Z")

</div>

I saw that you commented here but not the comment itself due to the moderation. My example is next to useless if you’re going 2d. Sorry.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 22, 2020, 7:50am UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/14 "2020-04-22T07:50:22Z")

</div>

There’s probably half a dozen ways of doing it, here’s one:

 ![300271-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/0/a30f2f3ba8d421da96aff89f27cf75f4a26f7641.png)

I added a custom Game Mode with a Player Controller to keep things civil and organised.

- I spawned some physics ‘ships’ above the board and let them fall with physics and gravity
- the script then checks what’s under the cursor, if it’s a Ship, we store a reference
- switch the physics and collision off so it does not interfere with anything else while we drag it around
- then we check what’s under the cursor; if it’s a tile, we interpolate the ship’s location to the location of that tile - this gives the movement a nice, smooth snap. The ship also is lifted 100uus above the tile, so it looks like it’s floating while it’s being dragged
- when the mouse is released, we snap the ship to the last known tile’s location (in case the interpolation did not finish) and clean up

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/b/ecb92578b5c2382e7ca287ec9e99afd7fd7d494f.gif)](https://gyazo.com/cbe8cefa014398f919cebd201c46551f)

There’s obviously tons of work to do here but it could be a fun and challenging learning (or even commercial, who knows how you spin it) project.

---

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 23, 2020, 4:09pm UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/15 "2020-04-23T16:09:05Z")

</div>

Thank you so much man ! I can start from this !

---

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 23, 2020, 4:09pm UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/16 "2020-04-23T16:09:08Z")

</div>

This screenshot you shared is from GameMode Scripting right?

---

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 23, 2020, 4:17pm UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/17 "2020-04-23T16:17:27Z")

</div>

thank you so much ! i did that scripting in custom player controller and set it in my custom game mode but for some reason, i am not able to lift and transport the base ship ! i did debugging by print string, everything is fine but i dont know why its not working

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 23, 2020, 4:21pm UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/18 "2020-04-23T16:21:21Z")

</div>

It’s Player Controller - any controls, key presses or so are better handled there.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 23, 2020, 4:22pm UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/19 "2020-04-23T16:22:56Z")

</div>

Can’t answer that without seeing what you’ve got. Btw, if you need me to, I can zip the project and push it your way so you have a working base. Do tell.

---

<div class="post-metadata">

**Author:** ![walidfstw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@walidfstw](https://forums.unrealengine.com/u/walidfstw)\
**Post date:** [April 23, 2020, 4:44pm UTC](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041/20 "2020-04-23T16:44:32Z")

</div>

That problem solved ! thank you so much mate ! i can’t thank you enough ! Now i am trying to build on this base !

[Next page](https://forums.unrealengine.com/t/i-want-to-create-a-game-similar-to-sea-battle-2-how-can-i-do-in-ue4/464041.md?page=2)
