If #godotengine only would have cone area shapes...

Subscribers:
64
Published on ● Video Link: https://www.youtube.com/watch?v=hjaFH0fQsWc



Duration: 0:41
64 views
1


Making a cctv camera in #Godot sadly the yellow is only a visual indicator the collision shape will be a cylider because godot dont support cones as areas...

I use 2 points sto get this effect
the point in the middle get moved half the distance so the height change keep it steady. The angle is the same i give the opening of the cam and it sacles it right to keep the form even with more distance.

@export_range (0.25, 20)
var range:float = 2.0:
get:
return range
set (value):
range = value
if visible_cone != null:
visible_cone.height = range
if center_cone != null:
center_cone.position.z = (range / 2.0)
if collision != null:
collision.shape.height = range
reangle_internal()

@export_range (5.0, 80.0)
var angle:float = 24.0:
get:
return angle
set(value):
angle = value
reangle_internal()

func reangle_internal():
var beta_angle:float = 180.0 - 90.0 - (angle/2.0)
var radius = (sin(deg_to_rad(angle/2.0)) / sin(deg_to_rad(beta_angle)) ) * range
if collision != null:
collision.shape.radius = radius
if visible_cone != null:
visible_cone.radius = radius




Other Videos By TheRealBlackNet


2025-07-07Fly test or is flying without friction fun??
2025-02-07Is godot good for 3D? No, you need 2D nodes and a shader and raycasts... so much work //Sarcasm
2024-12-31OnScreenTrigger - 3 regions 3 timing - one event
2024-07-20Reconnect the internet! #kenneyjam Manual Request Handling.
2024-05-26#godotengine - Learning #Godot - FPS Toolkit - Item Interaction
2024-03-27If #godotengine only would have cone area shapes...
2024-03-22#godotengine - Learning #Godot Test - Pickup and Throw on github
2024-03-17#godotengine - Learning #Godot Test - Pickup a box makes me fly...
2024-03-16#godotengine - Learning #Godot Test - Buttons display and overview on the object zoo.
2024-03-11#godotengine - Learning #Godot Test - valves and drop gates
2024-03-03Learning #GodotEngine - Shader lookup and Shadow Expanded
2024-03-02#godotengine - Learning #Godot Test - #Lidar - Better Shader - 40.000 Points+
2024-03-01Learning #GodotEngine - Shader Color By Distance from Camera
2024-02-29Learning #GodotEngine Test - Shaderfail
2024-02-28#godotengine - Learning #Godot Test - #Lidar exe or #ScannerSombre
2024-02-24a Kenney.nl screensaver idea made in #godotengine
2024-02-22Learning #Godot Test - Bullet Physics (Fail)
2024-02-18Learning #Godot Test - Item Pickup and Throwing - Pushing items
2024-02-14Help - How to set rotated\flipped tiles in a #godot Tilemap? And how to get rotation?
2024-02-10Learning #Godot Test - #Thief Magic Particles
2024-02-10Learning #Godot Test - Thief Water - Particles



Tags:
Godot
Camera
Tutorial