Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
This question was closed Dec 21, 2018 at 09:44 AM by SauronDark for the following reason:

Problem is not reproducible or outdated

avatar image
0
Question by SauronDark · Dec 18, 2018 at 01:08 PM · scripting problem

No overload for method 'Schedule' takes 4 arguments

So i am having an Issue with Scheduling an IJobParallelForTransform job

Unity Doc say :

public static Unity.Jobs.JobHandle Schedule(T jobData, int arrayLength, int innerloopBatchCount, Unity.Jobs.JobHandle dependsOn);

Parameters: jobData, arrayLength, innerloopBatchCount, dependsOn

base on that when i try to Schedule a job for ecample

Job Code

 public struct Myjob : IJobParallelForTransform
 {
     public NativeArray<float> PosXJ;
     private Vector3 PosJ;
     public void Execute(int index, TransformAccess transform)
     {
         PosJ = new Vector3(PosXJ[index], 0f, index);
         transform.position = PosJ;
     }
 }

Main code:

 *private int size = 100;
     public Transform prefab;
     private Transform[] points;
 
     private Myjob myjob;
     private JobHandle handle;
     NativeArray<float> posX;
     NativeArray<Vector3> pos;
     TransformAccessArray transforms;
 
     private void Start()
     {
         points = new Transform[size * size];
         posX = new NativeArray<float>(size, Allocator.Persistent);
         pos = new NativeArray<Vector3>(size, Allocator.Persistent);
         transforms = new TransformAccessArray(0, -1);
         transforms.capacity = points.Length;
         for (int x = 0; x < points.Length; x++)
         {
             points[x] = Instantiate(prefab, transform);
             transforms.Add(points[x]);
         }
     }
 
     private void Update()
     {
 
     for (int x = 0; x < size; x++)
         {
             posX[x] = x;
         }
 
         myjob = new Myjob()
         {
             PosXJ = posX
         };
 
         handle = myjob.Schedule(transforms, points.Length, 16, handle);
     }
 
     private void OnDisable()
        {
             handle.Complete();
             posX.Dispose();
             pos.Dispose();
             transforms.Dispose();
        }*

up on executing this, unity logs me with this error No overload for method 'Schedule' takes 4 arguments

also I cannot able to leave 4th parameter empty like this below, its still errors me for requirement of 4th parameter.

handle = myjob.Schedule(transforms, points.Length, 16);

However Error disappears in either below cases, handle = myjob.Schedule(points.Length, 16); and handle = myjob.Schedule(transforms);

my plan is to instantiate million Cubes with applied already shared, and then later to perform Sine calculation on each of them, for now I am just using Jobs system, kind of non ECS way, but learning it on the way.

sorry for not providing more details (if any, idk), I am still learning, anyway thanks in advance for taking interest in helping me :)

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
0

Answer by SauronDark · Dec 18, 2018 at 01:41 PM

I realized some logical problems too in my Example code, but never mind as long as these are not related with my main question, after all this is just an example code.

but i'd be apreaciate if someone provide me better way to change transform of GameObject via Jobs system, thanks again

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

232 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What is wrong with clamping? 1 Answer

Coroutines not running one after another 1 Answer

Making a connection point system like robocraft 0 Answers

Can someone help me with this camera orbiting script? 0 Answers

How do i make it so it cycles trough a list on input? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges