Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[C++] Different notations in Blueprint and C++

Hello guys, I noticed that there is disconcertingly a different notation of BP and C++ also intern in C++ classes.

Here the facts:

If you create a complete fresh Blueprint, lets say an actor for example the engine generates you 3 functions called "Event Begin Play", "Event Actor Begin Overlap" and finally the "Event Tick". last thing comes up with "Delta Seconds" like you can see on the following image.

alt text

easy to understand, fine this far. but lets switch over to C++. Inside the new generated actor class which is the same than the blueprint class VS generates the same 3 functions. Sure thats what it should do :) . But inside the .cpp the funcion with its body seems like this:

 void ADemoActor::Tick(float DeltaTime)

So I thought: "What the hell? Why two different times? or meanings ? One is called delta seconds in BP and the other one deltaTime in C++". So I jumped over to my browser for researching this and didn't find a solution because that was very strange to me. Later I noticed that this delta time means the same like delta seconds because of the header file .h . Inside there it is generated with delta seconds with the right name. But why different declared variables ? That is very irritating for people and this is just a quick fix inside the code to rename that.

 // Called every frame
     virtual void Tick(float DeltaSeconds) override;

Product Version: Not Selected
picture1.jpg (26.3 kB)
more ▼

asked Mar 17 '15 at 06:11 PM in Bug Reports

avatar image

287 14 18 199

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hey 3HMonkey-

I understand how the difference in names could be confusing when both variables are used in the same manner. If you would like to contribute to the engine development you can submit a pull request on www.github.com for the variable name to be changed. The pull request will then be reviewed for consideration of being merged into the engine.


Doug Wilson

more ▼

answered Mar 17 '15 at 07:24 PM

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

You don't need to respect the name for the parameters when you override a function. So while the function is defined as :

 virtual void Tick( float DeltaSeconds );

you can override it using another name:

 virtual void Tick(float anotherDeltaTimeParamName) override;

I actually beleive the feature to show "designers" other name is a great one since sometime the more technical terms can be confusing. This is the reason for different name, also know as "friendly name"

 UFUNCTION(BlueprintCallable, meta=(FriendlyName = "GetActorLocation", Keywords="position"), Category="Utilities|Transformation")
     FVector K2_GetActorLocation() const;

more ▼

answered Mar 17 '15 at 06:33 PM

avatar image

2.1k 70 38 260

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question