0

I'm making a top down survival game and I have done a procedural world gen using noise2D (FastNoiseLite). The next step was to randomize the seed, but I can't figure out how to... Thanks

I tried :

@export var noise_height_text : NoiseTexture2D
var noise : Noise
[...]
seed = randi_range(0,9000000000)
noise.seed() = seed

and

@export var noise_height_text : NoiseTexture2D
[...]
seed = randi_range(0,9000000000)
noise_height_text.seed() = seed

Both gives me the error : Only identifier, attribute access, and subscription access can be used as assignment target.

asked Jul 19, 2024 at 13:23

1 Answer 1

0

The error message you're getting is telling you that you can't assign a value to a function call (assignment target cannot be seed()). Try accessing/assigning the noise object's seed property, like so: noise.seed = seed.

answered Jul 19, 2024 at 13:32
Sign up to request clarification or add additional context in comments.

2 Comments

Ok I tried it and now it gives me a new error : Invalid set index 'seed' (on base: 'Nil') with value of type 'int' . I've tried to find a solution but It's not successful yet... I'll keep searching. Thanks for your help

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.