Search
Get Started
C
C#
•
3y ago
karkar
❔ flashlight strength
how would I make it so that my flashlights light gets dimmer the closer it gets to an object
https://paste.ofcode.org/gq5qhuX7Am2BwR3n4i8W6B
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,010
Members
View on Discord
Was this page helpful?
Yes
No
T
TheRanger
•
4/23/23, 9:21 PM
first u need to get the distance between the flash light and the object
T
TheRanger
•
4/23/23, 9:21 PM
with Vector3
.Distance method
K
karkar
OP
•
4/23/23, 9:23 PM
can you elaborate pls im very new
T
TheRanger
•
4/23/23, 9:28 PM
look up the api site of unity of this method
T
TheRanger
•
4/23/23, 9:28 PM
it gives you an example
T
TheRanger
•
4/23/23, 9:29 PM
https://docs.unity3d.com/ScriptReference/Vector3.Distance.html
T
TheRanger
first u need to get the distance between the flash light and the object
K
karkar
OP
•
4/23/23, 9:30 PM
but its not any object its just the general light of the flashlight on everything
T
TheRanger
•
4/23/23, 10:10 PM
try asking in
$unity
T
TheRanger
try asking in $unity
M
MODiX
•
4/23/23, 10:10 PM
https://discord.gg/unity
K
karkar
OP
•
4/24/23, 1:55 PM
ok thx
A
Accord
•
4/25/23, 2:13 PM
Was this issue resolved
? If so
, run
/close
/close
otherwise I will mark this as stale and this post will be archived until there is new activity
.