#💻┃code-beginner

1 messages · Page 599 of 1

swift crag
#

I would not write "interaction" as "int"

buoyant finch
#

I think you should use two seperate canvases instead of scenes

polar acorn
#
  1. I highly doubt the video says E is an int.
  2. I don't care what the video says, I'm asking you
simple vine
#

well i dont know

#

can i give someone the project to help then

polar acorn
buoyant finch
rich adder
#

well no wondering you are not learning anything, this wont even explain shit.

eternal falconBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

agile igloo
buoyant finch
simple vine
#

of what because there is none for the int

buoyant finch
buoyant finch
polar acorn
simple vine
#

how come he didnt use a code

buoyant finch
simple vine
#

can i send you my project for you to fix them things

polar acorn
#

take the time to actually learn how to use the engine

buoyant finch
simple vine
#

so i cant make my game WONDERFUL

polar acorn
polar acorn
#

if you attempt to put in zero effort, you will get zero game

rich adder
#

bro wants to shortcut his way through an entire game lol

buoyant finch
#

I think if you use events it will work better I myself use events almost all the time

agile igloo
#

@buoyant finch because there are multiple panels being set active and inactive, would it make sense to use an event or just disable everything that has to be disabled in one method?

buoyant finch
simple vine
#

for who

buoyant finch
simple vine
#

idk how he did it

buoyant finch
simple vine
#

huh

#

wasn't it of your game?

buoyant finch
simple vine
#

that what you just said

#

what does that mean

buoyant finch
#

I am asking that you paste here your cs script through which your game works

simple vine
#

which script

buoyant finch
#

this is your game's video or of the person who is giving the tutorial?

simple vine
#

the person

#

This is part 3 of my tutorial series where I teach you guys how to make a Slender-like horror game in Unity. Be sure to stay tuned for part 4 and more!

#Unity #Unity3D #gamedev

Scripts will be in pinned comment.

For more Unity tutorials like this or more videos in general - be sure to like, comment, and subscribe for more! 👍

Wishlist Bodh...

▶ Play video
rich adder
#

go back and start from the beginning then if its supposed to work like the video

#

double check all steps

agile igloo
#

im wondering, what are considered "advanced" unity problems? like dots?

fickle plume
#

That is not a tutorial, it's just a recoding of someone working on the project. You won't learn much just blindly miming someone else doing something, you need to understand what's happening.

buoyant finch
simple vine
#

that says HOW TO MAKE A SLENDER LIKE HORROR GAME

rich adder
#

it should be more like "Watch me make a slider like project"

agile igloo
buoyant finch
fickle plume
#

@simple vine If you have an actual coding question then ask here, explaining what you did and how you've attempted to debug it already.

polar acorn
fickle plume
#

Otherwise this is pointless

rich adder
buoyant finch
#

yeah

simple vine
swift crag
buoyant finch
polar acorn
simple vine
#

he made other tut that worked

simple vine
rich adder
#

no one is saying that

swift crag
#

option 2 is the less desirable option

polar acorn
#

If you choose to give up, that's on you

buoyant finch
rich adder
buoyant finch
simple vine
#

i cant

swift crag
#

I would suggest starting with Unity Learn.

simple vine
#

BECAUSE IT DONT WORK

swift crag
#

It will give you a foundation for creating your own game.

rich adder
#

forget tht tutorial

buoyant finch
# simple vine i cant

If you wanna prove me wrong learn and come back being a greater programmer then me

rich adder
#

"tutorial" you're following is shite

#

you ain'tgonna learn anything but copy and paste

simple vine
#

bruh this again

rich adder
#

and you can barley do that

swift crag
fickle plume
rich adder
buoyant finch
# simple vine BECAUSE IT DONT WORK

it doesn't work because you are directly starting from 3d which is not an issue but I would recommend firstly making 2d games with basic shapes to get some command on the language

simple vine
#

im quiting

swift crag
#

Okay.

#

When you're done quitting, consult Unity Learn.

buoyant finch
rich adder
#

no need to keep dragging this

simple vine
#

yea because you are being USELESS

rich adder
#

they were pointed to the resources, up to them what they do now

fickle plume
rich adder
buoyant finch
simple vine
polar acorn
rich adder
#

you seem to wanting to shortcut your way through making an entire game without knowing a lick of c# or unity

fickle plume
#

@simple vine Now, do you have actual programming questions?

undone spindle
#

I am learning from a Leonty source, and the instructor has a different version than mine. When I write the code he writes, I don't see the same results as he does. Is the issue related to the version?

rich adder
simple vine
swift crag
#

But it depends on context, of course.

#

Unity changes remarkably little from major release to major release -- some stuff eventually gets deprecated and removed

fickle plume
eternal falconBOT
swift crag
#

but the majority of stuff that worked back in Unity 5 continues to work now

rich adder
#

start from the beginning stages, work your way up

fickle plume
#

@simple vine If you don't stop bickering I will mute you. Research your question and post it here if you have one.

simple vine
#

then whats the point if yall being useless

polar acorn
rich adder
fickle plume
#

!mute 1323412736519966841 1d Start with Unity !Learn lessons, then come back here.

eternal falconBOT
#

dynoSuccess therealpugsbros_77594 was muted.

#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

buoyant finch
swift crag
#

no need to dogpile.

#

we will try again later.

swift crag
fast fern
#

I have a question
If I put a function in my script, would the game react if lets say I press a key that's supposed to make that function run?
Or does it have to be under like "public update" so the game always check if I pressed the key?

undone spindle
rich adder
swift crag
#

But merely creating a method doesn't do anything on its own

buoyant finch
swift crag
#

that was not really what the user was asking about

#

it is reasonable to point out that it's a bit weird to say "public update", though

#
public void Update() {

}

This is a method -- a function that's part of a class -- called "Update". It returns void, meaning it doens't return anything at all. Its access modifier is public, so anyone can see it

#

This method name is special. Unity looks for a method with this name on your MonoBehaviours and calls it every frame.

rich adder
#

i always keep my keep Update private protected void

swift crag
#

notably, it doesn't have to be marked as public -- the method can be private

fast fern
#

What about for example loading a different scene when collecting certain amount of points?

swift crag
#

you could check your point count in an Update method, perhaps

#

or you could check the condition every time you add points

undone spindle
#

This my code , and when i run the player doesn’t move or jump

swift crag
#

please use !code for large amounts of code

eternal falconBOT
swift crag
#

You should start by checking if your code is running at all. Use Debug.Log to print things to the console

undone spindle
#

Not move also

rich adder
undone spindle
fast fern
#

I haven't looked into events yet, currently trying to understand why my code didn't work as it's own function, but worked when it was under Public update

fast fern
#

I'll send a screenshot when I'm back on my laptop 👌

fast fern
#

Will do soon

rich adder
#

test out if things are running at all etc.

#

we debug usually by process of elimination

swift crag
#

process of elimination, you mean :p

rich adder
#

ops yes

#

my english still my secondary and fuck those up 😛

swift crag
#

you need to prove that your code is doing anything at all first

#

e.g. by logging a message at the start of Update, as well as logging the desired movement vector

lean pelican
#

What's the best way to deal with audio, brief sound effects in particular?
I'm using a singleton AudioManager class with a static PlayAudio method to be called from the object that wants to play a sound. But after that I saw multiple different ways of going about it online, and I'd like to know if there's a clear better/more sensible/efficient way.
For one, should the sound files be stored in the Audio Manager and it just gets a name/enum of the file it's supposed to play, or should every object hold its own sounds and pass them to the Audio Manager when it calls PlayAudio?
And two, should the AudioSource I use be a prefab in the AudioManager that gets instantiated at a location and then destroyed? Or should it be a child component of the AudioManager that gets moved around?
Actually, how important is the location of the AudioSource for 2D games in particular anyways? Or does it only matter if I actively try to get fancy with audio?

rich adder
#

my objects that make sound don't know anything about sound manager, they just get registered to it OnEnable, then an event is invoked and soundmanager deals with the playing (sound clip gets passed in the event) , if its 3D sound spawn the object at location with clip, if its a regular sound then play it through sound manager player

#

pooling the sound to spawn can be basically thought as having 50 not-active sound sources on stand-by and whenever a 3d sound is needed at location, activates the gamobject with its new values, after it plays goes back in the pool

lean pelican
#

I see. Thanks.
I already heard about pooling and Events/Listeners, so I'll look into those too.

timber tide
#

I'm lazy and I just use one-shots

rich adder
#

I mean I also use one-shots not sure if that changes anything lol

#

you mean PlayClipAtPoint ?

rich adder
timber tide
#

Ah yeah I see that one. For 3D sound but otherwise PlayOneShot suffices

rich adder
#

that creates a new gameobject each time and then cleans it up but it builds up quick

rich adder
#

i almost never use Play unless its like a background song or something

timber tide
#

oh right I guess if you just give it a position yourself

rich adder
#

as long as you got the new soundSource you can do PlayOneShot

#

i prefer it because it takes a clip so you dont need to swap the AS each time

#

if its a 3D sound -> Spawn the object that plays one shot at location
if its regular global sound -> play through sound manager as one shot

lean pelican
#

Right, that was a difference too. Is there a major difference between

myAudioSource.play();```
and 
`myAudioSource.PlayOneShot(myAudioClip)`
Espacially if I create myAudioSource from a prefab just before this and Destroy it afterwards?
rich adder
#

yes the latter cannot overlap sound

#

if you call Play on the same AS it stop the previous sound and plays from beginning

#

so if you must play another sound and its not ready you need to check or stop previous sound
myAudioSource.isPlaying == false
Play()

spark moth
#

can someone explain how i can put my code in a box in discord like in vs codes?

eternal falconBOT
rich adder
#

keep inline for small blocks, entire classes and large code like that goes in links

#

also this Discord server doesn't have line numbers for code blocks

spark moth
#

ok thanks i saved the code in paste.mod, now how can i paste it here? should i just press ctrl+v?

rocky canyon
#

copy and paste that new url

rich adder
#
You must be blind if you can't C#``` @spark moth
rocky canyon
#

Badum' Tisss!

rich adder
#

dad jokes!

knotty arch
#

Hello.
Would someone tell me if I should multiply by Time.deltaTime when using AddForce inside onTriggerStay?

rocky canyon
knotty arch
#

It works the same way as if I was using addforce inside fixedUpdate, right?

rocky canyon
#

mmhmm

knotty arch
rocky canyon
#

lol whats wrong?

rich adder
rocky canyon
#

i think they were just unsure if the Stay() method runs on the update loop or the fixedupdate loop

rich adder
#

ah okay

#

AddForce wait for physics tic anywho

rocky canyon
#

yessir

#

Addforce never needs time.deltaTime

#

i think is the point ur making

knotty arch
#

Thanks guys

#

🫡

rocky canyon
#

good luck 🍀

spark moth
#

is it ok if i send the link of my code from the website instead of pasting the code itself here? cuz i couldn't fix the problem

rich adder
#

thats the whole point of those links

spark moth
#

then explain how to paste the saved url from the website because ctrl+v just pastes the code like a normal text

rich adder
spark moth
rich adder
#

yup

spark moth
#

oh ok because it shows the link for me instead of the code in something like IDE

uncut shoal
#

How do I set the strength of a SpringJoint2D?

rich adder
#

on here you can use for small blocks the three ticks method

spark moth
rich adder
#

but this doesn't give line numbers and is generally for 5-7 lines

rich adder
spark moth
#

i'm making a game which has a movement like subway surfer but when i want to dodge an obstacle by changing
lane and then coming back to that lane, the game thinks i hit the obstacle what can be the problem? if u want i can send
the video or more codes
player movement code:
https://hastebin.skyra.pw/ucagabefiq.csharp

uncut shoal
#

👍

#

Thanks osmal

rich adder
spark moth
#

no, i was following brackeys tutorial but i'm now working on my self

rich adder
#

kinda strange to use both AddForce and movePosition.

#

MovePosition might be undoing proper collisions

spark moth
#

but if u want i can send the video of my problem

rich adder
#

if you want sure

spark moth
#

ok so wait i'll record one now

rich adder
rich adder
spark moth
#

so should i also send you the code of collision?

rich adder
#

wouldn't hurt

spark moth
#

ok i'll send both just wait a bit

rich adder
#

currentLane * 3; try to give numbers meaning by using variables

#

don't use magic numbers

spark moth
#

oh ok

chrome apex
#

I want an object to lose all moving force when something happens. Tried doing that with rb.velocity but nothing happens (IDE corrects it to linearvelocity, dunno if it's the same thing)

#

is this the rightway to go about this?

rich adder
rocky canyon
#

velocity is deprecated

chrome apex
#

I did that, doesn't seem to affect it hmm

rich adder
chrome apex
rocky canyon
#

^ make sure when u do it u have ur other movement code temporarily paused

spark moth
rocky canyon
#

just b/c u set it to 0 on one line doesn't mean something else wont re-write it if u hadn't paused the other stuff

chrome apex
rocky canyon
#

oh if its just a physics object u may want to turn off gravity.. when u set the velocity to 0

#

gravity obviously will continue to move it?

chrome apex
#

so setting it static will do the same, yea?

spark moth
rocky canyon
#

yea static should lock it in place..

#

not sure if thats the preferred method.. but def could work

spark moth
chrome apex
#

but see I don't want it to bounce of a wall...so when it hits this special thing, I want to lock it in place for just a moment, then let it go down again.

Can I just make it static then dynamic right in the next line? Will that do the trick?

rich adder
rocky canyon
#

no.. that'd just end up setting it to dynamic.. if its the same frame

#

myint = 3;
myint = 4;
myint = 5;

in the same frame is the same as

myint =5;

chrome apex
#

I see

#

so, a coroutine or something I guess

#

a short one

rocky canyon
#

you'll need a coroutine or something

#

yea

chrome apex
#

ok ok fair

rocky canyon
#

waittilnextframe may be good enough

chrome apex
#

but will that do what I want on a high level?

rich adder
rocky canyon
chrome apex
#

I mean will that achieve getting rid of the bounce and just letting go of the object downward

rocky canyon
#

not sure that sounds like a tryitandsee

chrome apex
#

ok

rich adder
#

I would suggest lookup a better tutorial video on this. Unity also has one pretty sure

spark moth
#

ok so i have to check the youtube. thank you very much and bye bye

rich adder
rich adder
#

so youcan better recognize where to improve on the youtubers u watchin

rocky canyon
#

those two dont quiet work the same as lerp.. (you wont run into unpredictable lerping and slowing towards the end)

rich adder
#

well that whole movement needs to go from
2 rb calls to just 1

#

using velocity at least

rocky canyon
#

u can use lerp correctly to fix those problems but with these two functions its built-in..

#

foolproof-ish

rocky canyon
#

        finalVector =
            (groundVector * finalSpeed) +
            (airVector * playerSettings.airSpeed) +
            (Vector3.up * gravitySim);

        characterController.Move(finalVector * Time.deltaTime);```

this is CC but same concept
rich adder
#

also time.DeltaTime is the reason you had to crank forward move to 40000

spark moth
#

ok you guys are going so fast lemme take notes

rocky canyon
#

lol you can always scroll back 😉

rich adder
#

erasing in 3....2....1.

spark moth
#

ik but sometimes i have to scroll 1 km back

#

ok if there is any other advice tell me and if there isn't i go

rich adder
rich adder
rocky canyon
#

lol j/k i got other plans

rich adder
#

i was thinking more like temple run

spark moth
#

thanks to both of u, and nav you got a new subscriber😉 bye

rich adder
rocky canyon
rich adder
#

yeah don't sleep on Spawn they got THE content

spark moth
rocky canyon
#

i was writing a lerp coroutine for an example even

rich adder
#

spawn camp out!

rocky canyon
#

me and nav are two threads from the same spoil

#
IEnumerator MoveToPosition(Vector3 targetPosition, float duration)
{
    Vector3 startPosition = transform.position;
    float startTime = Time.time;

    while (Time.time - startTime < duration)
    {
        float t = Mathf.Clamp01((Time.time - startTime) / duration);
        transform.position = Vector3.Lerp(startPosition, targetPosition, t);
        yield return null;
    }

    transform.position = targetPosition; // Ensure it reaches exactly the target
}```
#

i use code like this for lerping

#

caching the original position.. (that way u dont feed the variable back into itself)

spark moth
rich adder
#

woa never seen Time.time with a lerp, interesting

rocky canyon
#

transform.position = Vector3.Lerp(transform.position, targetPosition, Time.deltaTime);

#

this is how ppl normally do it.. and is wrong ^

spark moth
#

spawn can u give me ur yt link?

rich adder
#

ya wrry about lerping later lol

rich adder
#

first you should even figure how to limit your player to 3 specific lanes

rocky canyon
#

^ true..

spark moth
rocky canyon
#

oh are u making a temple run game?

rocky canyon
#

u might have a head-start

rich adder
#

seems like a waste of time learning this stuff just to move onto another engine

#

its not like its something you learn/ do overnight

rocky canyon
#

im 50% in agree-ance

spark moth
rocky canyon
#

it wont hurt to learn a bit of fundamentals from unity

#

but if u plan on gadot u should start optimizing what ur learning for that engine

rich adder
#

but thats quite false

#

Unity has WAYY more features that godot has to catch up to

#

but whatever works for you, game engines are like your favorite hammer

rocky canyon
#

ya, gadot is like half a decade behind imo (no offense)

spark moth
rocky canyon
#

unity's asset warehouse is bounds better as well 😛

timber tide
#

I can churn out stuff pretty quick with godot, but the optimization isn't there and it's taking time for them to catch up after redoing their pipeline

spark moth
#

that's why i think godot has better future and it's community is also growing non stop

rocky canyon
#

he's deprecating it

timber tide
#

if you want to learn at a lower level on how 3D engines work, godot is actually a good experience

rich adder
#

but yeah simple can be benificial for you

spark moth
rich adder
#

yea

spark moth
rich adder
#

its not a bad engine at all, it just wasn't right for me

verbal dome
timber tide
#

people say it's the 'easier' engine to learn, but I disagree and say it's easier to jump into, but harder to master since you've less tools available

rich adder
spark moth
night raptor
rich adder
rocky canyon
spark moth
night raptor
#

Unity has been under developement for 0 years open source

rich adder
rocky canyon
#

godot is more like entity system right?

timber tide
#

the language, built-in IDE (with built-in docs), and UI is by far the best thing about it

rocky canyon
#

i feel like the nodes things throws me off

verbal dome
timber tide
spark moth
rich adder
rocky canyon
#

ya, he said I hate.. ofc this is a "opinion based" subject in its own

#

no engine is subjectively better than another

rich adder
rocky canyon
#

unsubjectively? idk u get the idea

verbal dome
#

Isn't python's performance just really bad? Why do people choose it for something as performance critical as a game engine?

rocky canyon
#

anyway.. w/e u chose to do best of luck @spark moth

verbal dome
#

I suppose most engines are written in C++ and python is only for scripting, but still

spark moth
rocky canyon
rich adder
timber tide
#

only way godot succeeds unity is if unity goes bankrupt in the near future, or games get to the point where hardware exceeds the need for any more optimizations and then godot just because the 3D engine without any fees attached

night raptor
#

I think it has some really fast libraries in it. Any custom logic made in it is likely much slower than with compiled languages

verbal dome
#

From what i've seen, godot is like 10x slower in many cases compared to something like C#

rocky canyon
#

i feel like AI will be making games by that point

rocky canyon
rich adder
#

but why choose pythony syntax is what makes me skeeved out lol
Unreal did it with Verse scripting smh...

rocky canyon
#

i could see it being atleast a bit competitive w/ 2D

spark moth
verbal dome
#

That isn't related to game engines though is it

#

Not directly at least

rich adder
#

python better for data science and ML

rocky canyon
rich adder
#

but you could probably adapt any Functional programming for that

wintry quarry
#

AI tools being in Python is similar to how datascience tools used to all use MATLAB. It's like - just what the PHD mathy people knew.

timber tide
#

Godot is surprisingly fast, but the rendering has problems, even with the new pipeline. It feels more like built-in considering how easy it is to use multi-shader passes

spark moth
rich adder
#

why not ?

#

unreal isn't a stigma around here..

rocky canyon
#

just b/c it comes up so often

#

ud be suprised how many trolls come in.. and waste time and then say.. "well it doesnt matter, im going to Unreal"

rich adder
#

I still use unreal for other projects, not every engine fits everyones needs

rocky canyon
#

nice to have a thread to link as well when discussions like we're having now come up

#

but its missing gadot.

spark moth
#

according to google, C# is 4 times faster than godot and godot is faster than python

rich adder
#

google or google ai ?

night raptor
#

don't believe that

rocky canyon
#

👀 lol what?

rich adder
#

big difference

#

google AI just spews random crap

night raptor
#

no language is X times faster than other

rich adder
#

it all gets put into machine code lol

#

computer just wants 1s and 0s

verbal dome
#

"C# is faster than godot" doesn't make any sense

rich adder
#

i think they meant gd script

verbal dome
#

That would make more sense yeah

night raptor
#

Even then doesn't make much sense to say language is X times faster than other. It is all very much dependent on million things

spark moth
rich adder
#

interpretation time is probably more important

#

compiled languages dont deal with that though

sudden arch
#

If I have

    void OnApplicationQuit() {
        FlushMetrics().Forget();
    }

in a MonoBehaviour and

private async UniTask<FlushMetricsResult> FlushMetrics() {
// (...) nothing with await
    UnityWebRequest unityWebRequest = new UnityWebRequest(url, "POST");
// (...) nothing with await
    UnityWebRequest.Result result = await unityWebRequest.SendWebRequest();
// (...)

is it realiable that unityWebRequest.SendWebRequest() is called before the application closes?

#

I don't need the result.

rich adder
sudden arch
#

Yes, but it should fire.

rich adder
#

should fine , its just a GetRequest

spark moth
#

i want to make 2D metroidvania games that's why i don't care that much for the speed. i want the language to be user friendlly but have a decent speed not it being very fast but not user friendly

lean pelican
#

What's the most practical way of attaching an animation/animated sprite to a static 'main' sprite?
I've got an unchanging bird body sprite, and two wing sprites (pointing up and down), and I managed to create a FlapWings animation that looks decent enough, but if I just attach it to the Bird object via an animator, the wings replace the main body sprite (as was to be expected according to what I understand).
Do I just need to create a 'Wing' child object in Bird attached to its back that holds the Animator and FlapWings, or is there some other way?

spark moth
#

and i have to go bye

rich adder
spark moth
timber tide
#

it's cleaner but I don't see the difference really

#

you lack interfaces but not like you need interfaces with c# to make something with unity

rich adder
rich adder
# timber tide it's cleaner but I don't see the difference really
func _on_body_entered(body):
    hide() # Player disappears after being hit.
    hit.emit()
    # Must be deferred as we can't change physics properties on a physics callback.
    $CollisionShape2D.set_deferred("disabled", true)```
🥵 
```cs
private void OnBodyEntered(Node2D body)
{
    Hide(); // Player disappears after being hit.
    EmitSignal(SignalName.Hit);
    // Must be deferred as we can't change physics properties on a physics callback.
    GetNode<CollisionShape2D>("CollisionShape2D").SetDeferred(CollisionShape2D.PropertyName.Disabled, true);
}```
rocky canyon
#

what the func?

lean pelican
rich adder
lean pelican
#

I see, thanks.

rich adder
#

SpriteRenderer just gets the sprites swapped

rancid tinsel
#

is there any way to look up a value rather than key in a dictionary?

#

im doing an encryption puzzle, and want every letter to be a different letter but without duplication

#

nvm just rubber duckied myself

#

ignore me lol

#

ok I came up with this method, but out of curiocity is there a better/more efficient method of handling that?

#

so instead of looking for a value, I check it in the list instead

wintry quarry
#

The dictionary alone seems sufficient, no?

rancid tinsel
#

basically I need to also check if the value exists already for any key

wintry quarry
#

Make a hashset for the values

#

And check if the set contains it

#

But also

rancid tinsel
wintry quarry
#

Why do this select random letter thing

#

Just make a list of the letters

#

Duplicate it

#

Shuffle the duplicate

#

And then iterate over both lists in a for loop to set up the dictionary

rancid tinsel
#

that also sounds like a good idea I didn't think of that

#

is one or the other more efficient?

#

in terms of code I'm assuming yours is but out of curiocity is there a performance difference?

swift crag
#

It'd be worse if you had a huge pool of letters and only ever used a few

#

but if you usually exhaust the list, shuffling it once seems nicer to me

#

If you remove an item from the front of a list, all of the other items have to get moved up one position

#

Also, if you want to prevent a letter from encrypting to itself, that adds a little more complexity

#

(i have no idea if you want that)

#

from a cryptographic point of view it'd be a bad idea

runic lance
#

there's also the trick to swap the element with the last one and remove it to avoid incurring the list reorganization cost when removing elements

#

it messes up the ordering, but doesn't seem relevant in your case

swift crag
#

true!

rancid tinsel
swift crag
#

No.

runic lance
#

huh, just noticed that there's an extension method for it in the Unity.Collections package

swift crag
#

You walk backwards from the end of the list, swapping that position with the front of the list

runic lance
#

always thought it was built in for Lists

swift crag
#

for position X, you swap with probability 1/X

#

I forget the proof for this one. I remember learning it back in a randomized algorithms class..

rancid tinsel
#

ok so you work backwards - you roll a number based on the number of things left, and then whatever that number is, is the new index of whatever bit youre on?

swift crag
#

The index is never random.

#

You simply decide whether or not you do a swap.

rancid tinsel
#

im so confused it literally says "rolled"

swift crag
#

Yes.

#

You pick a random number between 1 and N

#

where N is your index (we're doing 1-indexing here)

#

If that number is 1, you swap the element at index N with the element at index 1

#

If it is not 1, you do nothing.

#

You perform this for every item in the list.

lean pelican
#

How do I stop a (looping) animation in an Animator? I have a bird flapping its wings (which are the animated part, in a child object, but I'm accessing the Animator from the parent Bird's script), and on a game over, I want the Animator to stop the animation, but myAnimator.StopPlayback() doesn't seem to work. (Starting the animation, and everything else in the game over code works, so that's not it). What am I missing?

rancid tinsel
#

if you only swap them if you roll 1 then you can end up with only 1 letter changed no?

rich adder
lean pelican
#

Until the game over it's supposed to loop, though. Or do I need to disable the looping via code if I want it to stop?

rancid tinsel
swift crag
#

yeah, I mis-remembered the algorithm

rancid tinsel
#

its alright it happens

swift crag
#

Yeah, you pick a random index and swap your current item with that index

#
        public static void Shuffle<T>(this List<T> list)
        {
            int index = list.Count - 1;
            while (index >= 0)
            {
                int i = Random.Range(0, index + 1);
                if (index != i) (list[index], list[i]) = (list[i], list[index]);
                --index;
            }
        }
rancid tinsel
#

the most important thing is you remember the name so you can look it up!

swift crag
#

I was worried I had also implemented it wrongly, haha

#

I was remembering part of the proof that the algorithm works right

#

specifically, proving that it gives you a 1/N chance for the original first item in the list to keep its position

#

(which you'd expect for a random shuffle)

rancid tinsel
#

oh wait

swift crag
#

If your list has 4 items, the odds that you never move the first item are

rancid tinsel
#

nvm

swift crag
#

3/4 * 2/3 * 1/2

#

and that gives you 1/4!

rancid tinsel
#

yeah because any space in the list has a chance to roll one

#

thats interesting

swift crag
#

so my algorithm would correctly shuffle the first item into the list

#

unfortunately it would not do much else

rancid tinsel
#

😭

#

are there any other common methods for shuffling lists like that?

#

now that you explained it the Fisher-Yates one makes a lot of sense, so it's hard for me to picture other methods

swift crag
#

your original code is another option

#

it's just not an in-place method

#

you need two separate lists

swift crag
rancid tinsel
#

yeah I think this method is slightly more optimised since I don't think I need the dictionary any more

coral cape
#

I have a float in one script im trying to update in a different one, I've referenced it at the beginning using
public RandomSpawner spawning;

But when I reference a public float I have in the other script later like such:
spawning.upgradedTime -= .5f;

It spits out "Object reference not set to an instance of an object" on the upgradedTime line, I didn't think I was even referencing an object here but I'm clearly missing something. Thank you for any help, sry if so basic I'm pretty new.

rich adder
#

unity wants to know which RandomSpawner you want

coral cape
#

How do I let it know which RandomSpawner? I should only have one class named such and it seems to recognize the upgradedTime var when I call it in my script in my editor. Sorry again j vry confused to this

rich adder
#

in Unity components are created by placing the script on the gameobject

#

then its now a created object from that template, and you can drop that into its inspector slot for your declared variable

coral cape
#

it makes sense I think, so sorry getting distracted from kid, thank you so so much for the answer though, I'll be back eventually to really give it a good read

wanton epoch
#

I am having this problem with my camera where, when I look on the display, it is perfectly fine and on top of my players eyes:

But as soon as I try to play my game, the camera goes to my characters hips and outside his body:

All of my camera position and orientation are set to be on top of the model but im not sure what is causing this

#

my cameras rotation seem to be reversed for some reason too?

frigid sequoia
#

Should I worry about that warning?

verbal dome
#

I would definitely rename them

frigid sequoia
#

Pretty sure is the only class with that method name

rich adder
wanton epoch
rich adder
chrome apex
#

!code

eternal falconBOT
chrome apex
#
// private void OnCollisionEnter(Collision collision)
    {
       if (collision.gameObject.CompareTag("Player"))
        {
            rb = collision.gameObject.GetComponent<Rigidbody2D>();
            //rb.linearVelocity = new Vector2(0, 0);
            rb.bodyType = RigidbodyType2D.Static;
            Debug.Log("collided");
        }
    }
#

Why is debug log not returning anything? They are physically colliding and everything seems fine otherwise

rich adder
chrome apex
#

ooooh

rich adder
#

you need the physics2d equivalent OnCollisionEnter2D

chrome apex
#

aaaah

#

ok thank you

wanton epoch
chrome apex
#

ah ok figured it out

rich adder
#

in pivot local mode

#

more importantly cameraPosition object

wanton epoch
#

Im sorry, this is my first time hearing about pivot points and pivot local mode. Ill look up what that is.

wanton epoch
rich adder
#

yeah show me the pivot for it

#

full context showing hierarchy and all

wanton epoch
#

This is my hierarchy if this is what you mnea

rich adder
#

yeah but with the pivot

#

so like show the arrows of it selected in the scene

wanton epoch
#

oooh

wanton epoch
rich adder
#

didn't we do this yesterday r something ? or someone else with the same exact setup

wanton epoch
#

wasnt me thats for sure

rich adder
# wanton epoch

if you're gonna crop dont crop the important bits, doesnt show if its local mode

rich adder
#

show the inspector for it

wanton epoch
#

CameraHolder

rich adder
#

oh

wanton epoch
#

and player cam is in player cam

rich adder
#

is it when you turn mouse that it goess offset ?

#

those scales could be a big problem

wanton epoch
#

No it just already is off set. When i look in the game display, it looks fine and im on the eyes of my avatar model.

#

But as soon as I actually play the game, my camera goes all the way down to the hips and im outside of the body

rich adder
wanton epoch
#

i can test that real quick

rich adder
#

also would still put scale on Camera holder and Camera to both 1,1,1

#

just incase

wanton epoch
#

Nope the problem is still there. Also, when im turning my mouse, my character turns the same direction as my mouse, but my actual crosshair turns the other direction

rich adder
#

why would crosshair be moving

#

is this not fpv ?

wanton epoch
#

sorry wrong phrasing, i mean my actual like direction im turning.

#

yes fpv

rich adder
#

aside from * Time.deltaTime

#

I dont think I see anything standing out wrong in code

wanton epoch
rich adder
# rich adder aside from `* Time.deltaTime`

never use * Time.deltaTime on mouse inputs, thats why your sens is crnked up to such high numbers.. Mouse input is already giving the distance moved since last frame so its already framerate independent

wanton epoch
#

oh ok

wanton epoch
#

all my controls become inverted as soon as I orientate my camera differently from the initial position

wanton epoch
rich adder
#

oh ok

wanton epoch
#

would there by any way to send you this project to show the issue more appropriatly? im not sure if im describing it properly

rich adder
#

eh maybe if it were a repo

#

I'm kinda on the go rn best I can view is code or videos tho

radiant frigate
#

hello! im having a problem where inside a function to initialize some managers in my game, i get that one of the manager was found, but whenever i try to use it in the rest of the code it says its null, does someone know what could be the problem?

https://hastebin.skyra.pw/ofexisotov.pgsql

The top console message and the bottom one are the relevant ones, i think they should be checking for the same script right?

#

ty in advance

rich adder
wanton epoch
#

what would be the best way to send it if its too big?

wanton epoch
#

ight gimme a sec

rich adder
radiant frigate
#

if thats what you are asking for, maybe i´m confused

rich adder
#

uh that doesnt line up

radiant frigate
#

wait let me check

rich adder
#

screenshot the full error ?

radiant frigate
#

the error?

#

okey

rich adder
#

ye

radiant frigate
#

i thought we were talking about the debug.log

rich adder
#

so armyGridManager is nul ?

radiant frigate
#

so it seems

rich adder
#

def is

radiant frigate
#

but in the debug.log that i made in line 166 it says it isnt

#

Oh its you navarone

rich adder
#

it seems by the time it hits that SavePlayer2ArmyInfo method is not there

radiant frigate
#

long time not see

rich adder
#

yea yo

wanton epoch
radiant frigate
#

it should set itself on initializeManagers method and not be changed afterwards

rich adder
radiant frigate
rich adder
#

Monobehaviour

radiant frigate
#

nope

#

its not

chrome apex
#
 GlassBlocks = GameObject.FindGameObjectsWithTag("glass");

        if (GlassBlocks.Length > 0)
        { foreach (GameObject block in GlassBlocks)

            {
                block.SetActive(true);
                Debug.Log("found em");
            } 
        }

OK why does this not work? The objects are checked for the correct tag and I initiate the search after they've been added into the scene

rich adder
#

above 70

radiant frigate
#

okey

rich adder
#

yup ok so its 100% armyGridManager being null

#

does clicking it bring you to the correct gameobject just incase?

radiant frigate
#

clicking the armyGridManager Variable?

rich adder
#

nah like the log

radiant frigate
#

ohh

#

lemme check

#

it shouldnt be a gameobject tho

#

since player isnt mb

#

or am i saying nonsense right now?

rich adder
#

I mean the log that printed this that has GameManager

#

just checking it isnt a bad clone or something gone wrong

radiant frigate
#

oh, its a singleton

#

or should be

rich adder
#

if you click the log it should show you which object its on

#

when you add context to Debug.Log as second param at least (hence the this keyword)`

radiant frigate
#

it doesnt highlight any gameobject in the scene

chrome apex
rich adder
radiant frigate
#

yes

#

Debug.Log($"Assining fights to {player2} from {armyGridManager}", this);

#

thats what i wrote on line 69

rich adder
#

weird normally it highlights the gameobject that spit it out

radiant frigate
#

hmm, im kinda lost

#

also this is my only scene

#

in case that helps with something

lapis yew
#

you forgot a whole set of brackets

rich adder
chrome apex
lapis yew
chrome apex
#

anyway, turns out finding objects with tag doesn't work on inactive objects which sucks

radiant frigate
chrome apex
#

guess I'm gonna have to find all objects and then compare tag

rich adder
radiant frigate
rich adder
#

now im wondering how any of them worked at all..

lapis yew
grand snow
rich adder
# radiant frigate
    {
        optionsManager = GetComponent<OptionsManager>();
        audioManager = GetComponent<AudioManager>();
        shopPoolManager = GetComponent<ShopPoolManager>();
        fightersOnSaleManager = GetComponent<FightersOnSaleManager>();
        armyGridManager = GetComponent<ArmyGridManager>();```
#

you know what GetComponent does right?

radiant frigate
#

it gets the component

rich adder
#

on THIS object

radiant frigate
#

or sets the variable to the component to get

chrome apex
radiant frigate
chrome apex
rich adder
grand snow
rich adder
#

if you want the component on the child use GetComponentInChilren

radiant frigate
#

get component in children

#

indeed

chrome apex
#

so type is a class here basically?

rich adder
#

classes are types yes

wanton epoch
#

@rich adder Sorry im back, did u have any chance to watch my video?

radiant frigate
grand snow
#

myComp = GetComponentInChildren<Blah>();

swift crag
#

a type is a kind of thing

#
public class Foo { }
public struct Bar { }
public enum Baz { }
public delegate void Buz();
#

all of these define types

rich adder
radiant frigate
#

yeah it makes sense

#

i said nonsense

#

if im checking if its null its dumb to set it later on

swift crag
#

types can be very broad, like unity's Object, or they can be very specific, like one of your own components

radiant frigate
#

lmao

rich adder
radiant frigate
#

but it still throws in an error

rich adder
#

also are you sure that InitializeManagers() is being called

grand snow
#

it has an arg you need to set to true to make it get from INACTIVE gameobjects

#

otherwise it will skip em

radiant frigate
radiant frigate
fleet venture
#

How do i get all objects of a specific component in the scene, i tried Resources.FindObjectsOfTypeAll<Prop>() but that also gets the stuff thats not in the scene

cerulean badger
#

Do I use Rigidbody2D for top-down jumping or smth else?

rich adder
grand snow
radiant frigate
fleet venture
swift crag
#

so using GameObject is unnecessarily specific

fleet venture
#

like is it also objects on the same level and stuff

#

oh

rich adder
#

oh right its Object

fleet venture
#

ok ill just try it

#

and see if it works

swift crag
#

The method is a bit weird to me. It finds any kind of Unity object

#

but it also has special rules for inactive game objects

grand snow
rich adder
swift crag
fleet venture
#

is it deprecated?

#

i cant navigate to it

rich adder
#

yeah new one is Like find First of Any type or some shit

fleet venture
#

idk what the line means

swift crag
#

oh yeah, it's been replaced with FindObjectsByType

fleet venture
#

ah

rich adder
#

the IDE tells you replacement

swift crag
#

The new methods explicitly ask you whether you care about order

#

I find it annoying; I wish they would at least default to being ordered (thus matching FindObjectsOfType)

rich adder
#

new method also specified inactive in a enum instead of bool

#

i think

steep dust
#
 public class NpcWaypointGroupEditor : UnityEditor.Editor
 {
     private void OnSceneGUI()
     {
         Event e = Event.current;

         if (e.type == EventType.MouseDown && e.button == 0)
             Debug.Log("LMB was pressed");
     }
 }

why is the text never logged to the console? Ik onscenegui is getting called but the ifstatement is always false.

fleet venture
grand snow
rich adder
fleet venture
#

Great it works!

rich adder
#

unity 2d colliders only work in X,Y space so you gotta take that into consideration @cerulean badger

fleet venture
#

thank you!

swift crag
#

that's not an asset

grand snow
#

hmm thats not something i thought of 🤔 no idea tbh

rich adder
#

doesn't it also work with Interfaces, or is that just GetComponent

cerulean badger
grand snow
rich adder
radiant frigate
#

im checking and modifying some things in case its the mythical "oh, how couldnt i have thought about that b4" but cant get to it

rich adder
radiant frigate
rich adder
#

I have a feeling its somehow being called before InitializeManagers()

radiant frigate
#

it should not, since initialize should be instant, and i press the button on a few seconds of delay

rich adder
radiant frigate
#

i write the debug.log exactly after line 106 right ?

rich adder
#

oh wait u do have a bunch of logs after, did t

radiant frigate
grand snow
#

this is going in circles plz learn how to use a debugger to figure this out 😐 @radiant frigate

modest dust
#

This whole initialization problem could probably be avoided if these managers were simply attached to the game manager and referenced via inspector

keen dew
#

I'm pretty sure the game manager you've dragged into the button is not the same as the singleton that has all the stuff set up

rich adder
#

tbh this ^ prob

steep dust
#

how do I detect cntrl left click inside of the scene view in an ediot script?

rich adder
#

i cant think of anything else

steep dust
#

ok

rich adder
#

there is like an event trigger type thing for editor though afaik

keen dew
#

The method on the button should really be something like

public void NextGameStateForButton()
{
    GameManager.instance.NextGameState();
}

That way you make sure that it's calling the instance's method

radiant frigate
swift crag
#

i really don't like using GetComponentInChildren

#

it can blow up in your face in some surprising ways

rich adder
#

serializing in inspector > GetComponent on self/children

swift crag
#

(like when you add a new component and it gets grabbed instead of the existing one)

steep dust
radiant frigate
#

btw hi caesar !

modest dust
radiant frigate
#

also long time no see

modest dust
#

And hi

grand snow
#

beginners do some truly weird things before they learn the ways of [SerializeReference]

rich adder
#

ideally, the only time one should really use GetComponent is when grabbing a dynamic object and usually doing TryGetComponent

swift crag
#

GetComponentInParent is a lot nicer. You often have one obvious correct answer there

#

I use that for things that must be attached to one of my game menus, so that I don't have to tell them all about the MenuController

#

GetComponent makes sense when component A absolutely must always be next to component B

radiant frigate
swift crag
#

But even then, I prefer to just make it explicit

#

I'm curious what was breaking previously.

radiant frigate
swift crag
#

I wonder if the game manager getting moved to DontDestroyOnLoad broke something

radiant frigate
#

but as a wise man said (probably) "dont repair whats not broken"

#

might be the case

rich adder
#

if it aint broke...wait..

swift crag
#

I'm pretty sure instantiating with a parent that lives in DDOL is fine

#

i do that a lot in my menu code

radiant frigate
swift crag
#

it's not like it winds up in the main game scene and gets lost

grand snow
#

if it works but fucking shit then refactor it later ™️

rich adder
#

//Todo: will need to refactor this
3 years later...yeah that aint done

modest dust
#

I love piling up technical debt

radiant frigate
#

tbf im doing a very small game that should not become spaguetti code enough to make me want to start from 0 once i learn more about coding

rich adder
#

spoiler alert: most of your beginning projects will be spaghetti no matter how hard you try

grand snow
#

oh yea the code we wrote when learning was trash but you gotta learn!

rich adder
#

with time you refine how well those systems you make become

radiant frigate
#

you guys are all goated

rich adder
#

also at the end of the day you're making a game, it just needs to be fun and more or less performant . No one is gonna look or care about the code, as long as you are able to mantain it is the main thing

radiant frigate
#

ty for the big help

radiant frigate
#

(by demo i mean mini game, prolly wrong term)

rich adder
radiant frigate
#

what is netocode?

rich adder
#

neato code. typo lol

radiant frigate
#

no clue what that is

#

tbf im so much of a begginer on coding

rich adder
radiant frigate
#

i have a random 2 week minecraft phase but isntead of minecraft coding

radiant frigate
rich adder
radiant frigate
#

ohhh

#

okay

rich adder
#

coop type deal

radiant frigate
#

so a multiplayer game

rich adder
#

yea

radiant frigate
#

thats the difference right?

rich adder
#

yea

radiant frigate
#

hence the "networking code"

rich adder
#

I like the cooler term "over the wire"

radiant frigate
#

makes sense now

#

LMAO

#

i would love to do it online also, but i want to actually finish it and dont get depression lol

rich adder
radiant frigate
#

if you wanna infodump me about your games

rich adder
#

will do UnityChanSalute

radiant frigate
#

i wonder how its going to caesar

#

hope everything with his game is going well

modest dust
radiant frigate
modest dust
primal cliff
#

Hi, I need to assign my object named src to this, but it's not in the hierarchy as it's from another scene which transitions into the one I'm working on right now, meaning that I can't drag it into here.
Is there a way I can do that? or would I need to use another method?

modest dust
#

Pass the reference to it via code

primal cliff
#

would I need to do it in any special Unity way or can I do that as I would with general c#?

timber tide
#

Can always handle audio in a global matter and make a singleton that holds onto them

modest dust
#

You need a reference to your audio source, reference to the component with the src field, pass it in

#

A singleton is one way to do it.

primal cliff
#

thanks, worked

rancid tinsel
#

guys how on earth do i fix NUnit.Framework not being recognised as a namespace

#

ive got a Assets/Tests/Editor folder where the test script is with an assembly definition file

wintry quarry
rancid tinsel
wintry quarry
#

for example

rancid tinsel
#

ohhh

#

now test runner doesnt see it wtf

#

ok i had to remove the tests folder entirely

#

and generate it via test runner and that seems to have fixed it

#

so unintuitive though

#

also for some reason it's also not seeing inheriting classes, only the base class

#

it sees BaseCipher and not the other two despite sharing the same asmdf file

wintry quarry
#

wdym it "sees" them

#

what sees them?

rancid tinsel
#

ok it just fixed

#

wtf

wintry quarry
#

What's in them? What are you trying to do? What errors are you getting?

rancid tinsel
#

visual studio*

#

this will fix if i change it

wintry quarry
#

probably just needed to regenerate project ifles

rancid tinsel
#

as in retype it

rancid tinsel
#

no its back to being broken

#

im going to restart unity and hope it fixes

#

ok now there are no tests apparently

wintry quarry
rancid tinsel
#

yes

wintry quarry
#

And CaesarCipher is in that game assembly?

#

Just go back and make sure all your asmdef changes were saved

rancid tinsel
#

they were saved

#

and yes its in the same one

rancid tinsel
wintry quarry
#

You spelled the name wrong?

#

Yep you did

#

I see ea vs ae

rancid tinsel
#

XD

#

thanks for the help though

wind hinge
#

Im pissed off… how do I get audio to not desync when using Unity recorder package with Timeline? Sound effects too near the start of the TL are playing desynced. I already set the sounds in import settings to preload

slender nymph
#

this is a code channel

rancid tinsel
#

could someone explain this to me or point to a resource, I sort of get what it's doing but it's hard to wrap my head around

mossy depot
#

how do i fix this? its my first time trying to code something i just followed a tutorial

rancid tinsel
teal viper
mossy depot
wintry quarry
# rancid tinsel could someone explain this to me or point to a resource, I sort of get what it's...

characters are just numbers in the computer. You can use this table to get the numerical equivalent for the letters:
https://www.asciitable.com/
A is number 65.

So B would be 66

If letter is B, then index will be 1, since you did 66 - 65

#

Basically you're calculating the index in that alphabet array

wind hinge
wintry quarry
#

So B - A is 66 - 65, which gives us 1, which is perfect because B is at index 1 in that array

rancid tinsel
#

still so hard to do in my head though

wintry quarry
#

That's why we have the computers do it for us

polar acorn
rancid tinsel
#

might be because its late too

polar acorn
#

You don't need to know what numbers each letter is

#

you just need to know they're in order

teal viper
mossy depot
#

how do i fix this?

wintry quarry
#

Also get your IDE configured

#

!ide

eternal falconBOT
wintry quarry
#

variables in C# need a name.
e.g.
private <type> <name>;
You just have private <type>;

mossy depot
#

oh yea

#

u guys are smart

frigid sequoia
#

Can I not see the [HideInInspector] parameters on debug mode?

#

I kinda just want to hide them for the normal view

deft loom
#

whats the simplest way to add a reliable fps counter that won't itself poorly impact framerate?

wintry quarry
swift crag
#

it would be impressive if you created a framerate counter that made your game lag

inland terrace
#

is there a way to play my unity project without alt tabbing from visual studio?

rich adder
#

Attach Unity

rich adder
inland terrace
rich adder
inland terrace
#

ah.. it gives me an error in some random script. i guess alt tabbing is required

inland terrace
#

playmode via unity works just fine

rich adder
#

are those old? you got some compile errors

inland terrace
#

ah nvm fixed it. extension was for some reason attached to the function. i guess i have to enable the debug mode to use that button

rich adder
inland terrace
#

got it ty!

inland terrace
#

oh wth i can leave playmode running.. edit a script and have the game updated?

#

cool beans

rich adder
#

sometimes you will get Missing script errors

#

best to reset if major changes done

inland terrace
#

got it

dawn heron
#

hey

#

i'm new to unity can anyone suggest me how to get started and learn on how to make scripts for player movement in a 2d game

rich adder
dawn heron
#

thank you

frigid sequoia
#

This is a thing I can do with methods right?

slender nymph
lean pelican
#

What's the most sensible/practical way to have audio (in my case just a short clip) keep playing through scene loading?
I figured it out via DontDestroyOnLoad(myAudioSource) and then Destroy(myAudioSource, myAudioClip.lenght), but I was wondering if
a) there's some other better way of doing it, and
b) if the Destroy() call even happens if the GameObject that the script is in gets destroyed by the new scene loading?

slender nymph
#

Destroy is a static method, it has no information about what object it was invoked from so it would still happen, yes

cosmic dagger
lean pelican
#

Speaking of static, for Singleton manager classes (in this case my AudioManager) do I need to have them attached to a GameObject in every scene I want to use them in? Or is it possible to just create them once in the start/main menu scene and once they exist they're accessible from anywhere?

slender nymph
#

you can use DontDestroyOnLoad

lean pelican
#

I know. And if I do do I still need the script to exist in a GameObject in every scene to reference it or not?

slender nymph
#

what do you think DontDestroyOnLoad does

cobalt flare
#

well

#

i need help with buttons i cant click them therefore cant test;

slender nymph
#

doesn't sound like a code question. but make sure you have an event system in the scene

cobalt flare
#

ok

#

sprry

lean pelican
#

...I'm new and don't know all the specifics, why do you think I'm asking.
Also more to the point what's good practice? Do I just start my singletons in the main menu/boot up and then forget about them as long as I can be sure they exist? Or is there any point to have them lying around in every relevant scene too?

slender nymph
#

you've provided almost no information so i couldn't possibly say what you need to do